summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/openssh/sshd
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-03-01 20:47:01 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-03-01 20:47:01 (GMT)
commitf5380fc59334f8b8cdf73d16e23d7e59a96ea80b (patch)
treef88c813f6d673b5ec72b71b8ffae696c4027b052 /abs/mv-core/openssh/sshd
parentf2f661dad3f31c477f51d0165f29d9ba19a411c3 (diff)
downloadlinhes_pkgbuild-f5380fc59334f8b8cdf73d16e23d7e59a96ea80b.zip
linhes_pkgbuild-f5380fc59334f8b8cdf73d16e23d7e59a96ea80b.tar.gz
linhes_pkgbuild-f5380fc59334f8b8cdf73d16e23d7e59a96ea80b.tar.bz2
Making my own ssh pkg.
I don't need or want a padded helmet.
Diffstat (limited to 'abs/mv-core/openssh/sshd')
-rwxr-xr-xabs/mv-core/openssh/sshd40
1 files changed, 40 insertions, 0 deletions
diff --git a/abs/mv-core/openssh/sshd b/abs/mv-core/openssh/sshd
new file mode 100755
index 0000000..875028a
--- /dev/null
+++ b/abs/mv-core/openssh/sshd
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/sshd
+
+PID=`cat /var/run/sshd.pid 2>/dev/null`
+case "$1" in
+ start)
+ stat_busy "Starting Secure Shell Daemon"
+ [ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; }
+ [ -z "$PID" ] && /usr/sbin/sshd $SSHD_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon sshd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Secure Shell Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon sshd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0