summaryrefslogtreecommitdiff
path: root/contrib/solaris/opensshd.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/solaris/opensshd.in')
-rwxr-xr-xcontrib/solaris/opensshd.in16
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/solaris/opensshd.in b/contrib/solaris/opensshd.in
index d1d573eb8..212254dc8 100755
--- a/contrib/solaris/opensshd.in
+++ b/contrib/solaris/opensshd.in
@@ -5,14 +5,16 @@
5 5
6AWK=/usr/bin/awk 6AWK=/usr/bin/awk
7CAT=/usr/bin/cat 7CAT=/usr/bin/cat
8EGREP=/usr/bin/egrep
9KILL=/usr/bin/kill 8KILL=/usr/bin/kill
10PS=/usr/bin/ps 9PS=/usr/bin/ps
10XARGS=/usr/bin/xargs
11 11
12prefix=%%openSSHDir%% 12prefix=%%openSSHDir%%
13etcdir=%%configDir%% 13etcdir=%%configDir%%
14piddir=%%pidDir%%
14 15
15SSHD=$prefix/sbin/sshd 16SSHD=$prefix/sbin/sshd
17PIDFILE=$piddir/sshd.pid
16SSH_KEYGEN=$prefix/bin/ssh-keygen 18SSH_KEYGEN=$prefix/bin/ssh-keygen
17HOST_KEY_RSA1=$etcdir/ssh_host_key 19HOST_KEY_RSA1=$etcdir/ssh_host_key
18HOST_KEY_DSA=$etcdir/ssh_host_dsa_key 20HOST_KEY_DSA=$etcdir/ssh_host_dsa_key
@@ -21,28 +23,28 @@ HOST_KEY_RSA=$etcdir/ssh_host_rsa_key
21killproc() { 23killproc() {
22 _procname=$1 24 _procname=$1
23 _signal=$2 25 _signal=$2
24 ${PGREP} ${_procname} | ${HEAD} -1 | ${XARGS} -t -I {} ${KILL} -${_signal} {} 26 ${PS} -u root | ${AWK} '/'"$_procname"'$/ {print $1}' | ${XARGS} ${KILL}
25} 27}
26 28
27 29
28checkkeys() { 30checkkeys() {
29 if [ ! -f $HOST_KEY_RSA1 ]; then 31 if [ ! -f $HOST_KEY_RSA1 ]; then
30 $SSH_KEYGEN -t rsa1 -f $HOST_KEY_RSA1 -N "" 32 ${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N ""
31 fi 33 fi
32 if [ ! -f $HOST_KEY_DSA ]; then 34 if [ ! -f $HOST_KEY_DSA ]; then
33 $SSH_KEYGEN -t dsa -f $HOST_KEY_DSA -N "" 35 ${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N ""
34 fi 36 fi
35 if [ ! -f $HOST_KEY_RSA ]; then 37 if [ ! -f $HOST_KEY_RSA ]; then
36 $SSH_KEYGEN -t rsa -f $HOST_KEY_RSA -N "" 38 ${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N ""
37 fi 39 fi
38} 40}
39 41
40stop_service() { 42stop_service() {
41 if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then 43 if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then
42 PID=`cat ${PIDFILE}` 44 PID=`${CAT} ${PIDFILE}`
43 fi 45 fi
44 if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then 46 if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then
45 $KILL $PID 47 ${KILL} ${PID}
46 else 48 else
47 echo "Unable to read PID file, killing using alternate method" 49 echo "Unable to read PID file, killing using alternate method"
48 killproc sshd TERM 50 killproc sshd TERM