diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-06-11 12:18:01 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-06-18 16:22:13 +0200 |
commit | 28db1773524eb763569939d4066e32dbf50c69a0 (patch) | |
tree | 964e2f4165b48179d7ac39ac8d472788d60f99f0 /projectroot/etc/init.d/openssh | |
parent | 878707bd943a04fc8e3a55a151499359e81ce780 (diff) | |
download | ptxdist-28db1773524eb763569939d4066e32dbf50c69a0.tar.gz ptxdist-28db1773524eb763569939d4066e32dbf50c69a0.tar.xz |
generic: rename generic -> projectroot
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'projectroot/etc/init.d/openssh')
-rw-r--r-- | projectroot/etc/init.d/openssh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/projectroot/etc/init.d/openssh b/projectroot/etc/init.d/openssh new file mode 100644 index 000000000..b65880e5d --- /dev/null +++ b/projectroot/etc/init.d/openssh @@ -0,0 +1,60 @@ +#!/bin/sh + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/sshd +NAME=sshd +PIDFILE=/var/run/sshd.pid + +case "$1" in + + start) + mkdir -p /var/run/sshd + + echo -n "starting sshd..." + start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" > /dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "done" + else + echo "failed" + exit 1 + fi + ;; + + stop) + echo -n "stopping sshd..." + start-stop-daemon -K -p $PIDFILE > /dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "done" + else + echo "failed" + exit 1 + fi + ;; + + restart|force-reload) + echo -n "restarting sshd..." + start-stop-daemon -K -x "$DAEMON" -p $PIDFILE > /dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "done" + else + echo "failed" + exit 1 + fi + sleep 1 + start-stop-daemon -S -x "$DAEMON" -p $PIDFILE > /dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "done" + else + echo "failed" + exit 1 + fi + ;; + + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 + |