adapt ssh script to use our generic functions.

svn path=/nixpkgs/trunk/; revision=5028
This commit is contained in:
Armijn Hemel 2006-03-10 17:22:58 +00:00
parent 9159ca026d
commit 1fdbc347ce

View File

@ -13,7 +13,7 @@
# pidfile: /var/run/sshd.pid # pidfile: /var/run/sshd.pid
# source function library # source function library
. @initscripts@/etc/rc.d/init.d/functions source @initscripts@/functions
# pull in sysconfig settings # pull in sysconfig settings
[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd [ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
@ -34,7 +34,7 @@ do_rsa1_keygen() {
if [ ! -s $RSA1_KEY ]; then if [ ! -s $RSA1_KEY ]; then
echo -n $"Generating SSH1 RSA host key: " echo -n $"Generating SSH1 RSA host key: "
if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
@coreutils/bin/chmod 600 $RSA1_KEY @coreutils@/bin/chmod 600 $RSA1_KEY
@coreutils@/bin/chmod 644 $RSA1_KEY.pub @coreutils@/bin/chmod 644 $RSA1_KEY.pub
success $"RSA1 key generation" success $"RSA1 key generation"
echo echo
@ -88,7 +88,7 @@ do_restart_sanity_check()
fi fi
} }
start() startService()
{ {
# Create keys if necessary # Create keys if necessary
do_rsa1_keygen do_rsa1_keygen
@ -96,13 +96,14 @@ start()
do_dsa_keygen do_dsa_keygen
echo -n $"Starting $prog:" echo -n $"Starting $prog:"
@initscripts@/sbin/initlog -c "$SSHD $OPTIONS" && success || failure #@initscripts@/sbin/initlog -c "$SSHD $OPTIONS" && success || failure
$SSHD $OPTIONS
RETVAL=$? RETVAL=$?
[ "$RETVAL" = 0 ] && @coreutils@/bin/touch /var/lock/subsys/sshd [ "$RETVAL" = 0 ] && @coreutils@/bin/touch /var/lock/subsys/sshd
echo echo
} }
stop() stopService()
{ {
echo -n $"Stopping $prog:" echo -n $"Stopping $prog:"
killproc $SSHD -TERM killproc $SSHD -TERM