summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/solaris/buildpkg.sh9
-rwxr-xr-xcontrib/solaris/opensshd.in16
2 files changed, 15 insertions, 10 deletions
diff --git a/contrib/solaris/buildpkg.sh b/contrib/solaris/buildpkg.sh
index a71417075..05abb2236 100755
--- a/contrib/solaris/buildpkg.sh
+++ b/contrib/solaris/buildpkg.sh
@@ -24,6 +24,7 @@ make install-nokeys DESTDIR=$FAKE_ROOT
24## Fill in some details, like prefix and sysconfdir 24## Fill in some details, like prefix and sysconfdir
25ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'` 25ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'`
26PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2` 26PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2`
27PIDDIR=`grep "^piddir=" Makefile | cut -d = -f 2`
27cd $FAKE_ROOT 28cd $FAKE_ROOT
28 29
29## Setup our run level stuff while we are at it. 30## Setup our run level stuff while we are at it.
@@ -37,12 +38,14 @@ mkdir -p $FAKE_ROOT/etc/rc2.d
37## setup our initscript correctly 38## setup our initscript correctly
38sed -e "s#%%configDir%%#$ETCDIR#g" \ 39sed -e "s#%%configDir%%#$ETCDIR#g" \
39 -e "s#%%openSSHDir%%#$PREFIX#g" \ 40 -e "s#%%openSSHDir%%#$PREFIX#g" \
41 -e "s#%%pidDir%%#$PIDDIR#g" \
40 ../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd 42 ../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd
41chmod 711 $FAKE_ROOT/etc/init.d/opensshd 43chmod 711 $FAKE_ROOT/etc/init.d/opensshd
42 44
43ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd 45ln -s ../init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd
44ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd 46ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc0.d/K30opensshd
45ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd 47ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd
48ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd
46 49
47 50
48## Ok, this is outright wrong, but it will work. I'm tired of pkgmk 51## Ok, this is outright wrong, but it will work. I'm tired of pkgmk
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