2007-07-23 13:00:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# sshd Starts sshd.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Make sure the ssh-keygen progam exists
|
|
|
|
[ -f /usr/bin/ssh-keygen ] || exit 0
|
|
|
|
|
2014-08-03 03:21:19 +02:00
|
|
|
# Create any missing keys
|
|
|
|
/usr/bin/ssh-keygen -A
|
2014-02-03 03:01:28 +01:00
|
|
|
|
2007-07-23 13:00:59 +02:00
|
|
|
umask 077
|
|
|
|
|
|
|
|
start() {
|
2013-08-21 03:11:00 +02:00
|
|
|
echo -n "Starting sshd: "
|
2007-07-23 13:00:59 +02:00
|
|
|
/usr/sbin/sshd
|
|
|
|
touch /var/lock/sshd
|
|
|
|
echo "OK"
|
2013-08-21 03:11:00 +02:00
|
|
|
}
|
2007-07-23 13:00:59 +02:00
|
|
|
stop() {
|
|
|
|
echo -n "Stopping sshd: "
|
2013-08-21 03:11:00 +02:00
|
|
|
killall sshd
|
2007-07-23 13:00:59 +02:00
|
|
|
rm -f /var/lock/sshd
|
2013-08-21 03:11:00 +02:00
|
|
|
echo "OK"
|
2007-07-23 13:00:59 +02:00
|
|
|
}
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
2013-08-21 03:11:00 +02:00
|
|
|
}
|
2007-07-23 13:00:59 +02:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2013-08-21 03:11:00 +02:00
|
|
|
start
|
2007-07-23 13:00:59 +02:00
|
|
|
;;
|
|
|
|
stop)
|
2013-08-21 03:11:00 +02:00
|
|
|
stop
|
2007-07-23 13:00:59 +02:00
|
|
|
;;
|
|
|
|
restart|reload)
|
2013-08-21 03:11:00 +02:00
|
|
|
restart
|
2007-07-23 13:00:59 +02:00
|
|
|
;;
|
|
|
|
*)
|
2012-03-15 22:08:09 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
2007-07-23 13:00:59 +02:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|
|
|
|
|