summaryrefslogtreecommitdiff
path: root/package/openssh/files/sshd.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/openssh/files/sshd.init')
-rw-r--r--package/openssh/files/sshd.init50
1 files changed, 0 insertions, 50 deletions
diff --git a/package/openssh/files/sshd.init b/package/openssh/files/sshd.init
deleted file mode 100644
index d9adb5f25..000000000
--- a/package/openssh/files/sshd.init
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-#PKG openssh-server
-#INIT 50
-. /etc/rc.conf
-
-case $1 in
-autostop) ;;
-autostart)
- test x"${openssh:-NO}" = x"NO" && exit 0
- grep "^dropbear" /etc/rc.conf >/dev/null 2>&1 || dropbear=NO
- if [[ $openssh = AUTO && $dropbear != NO ]]; then
- echo openssh not starting: set to AUTO and dropbear is enabled
- exit 0
- fi
- test x"$openssh" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
- exec sh $0 start
- ;;
-start)
- if [[ ! -s /etc/ssh/ssh_host_rsa_key ]]; then
- mkdir -p /etc/ssh
- if [[ ! -x /usr/bin/ssh-keygen ]]; then
- echo "openssh not starting: SSH private key missing"
- exit 0
- fi
- echo "openssh: generating SSH private key (RSA)"
- /usr/bin/ssh-keygen -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key
- rv=$?
- echo openssh: key generation exited with code $rv
- [[ $rv = 0 && -s /etc/ssh/ssh_host_rsa_key ]] || exit 1
- fi
- mkdir -p /var/run/sshd
- mkdir -p /var/empty
- touch /var/log/btmp && chmod 600 /var/log/btmp
- /usr/sbin/sshd
- ;;
-stop)
- if [ -e /var/run/sshd.pid ]; then
- kill $(cat /var/run/sshd.pid)
- fi
- ;;
-restart)
- sh $0 stop
- sh $0 start
- ;;
-*)
- echo "Usage: $0 {start | stop | restart}"
- exit 1
- ;;
-esac
-exit $?