diff options
author | Achim Gottinger <achim@gentoo.org> | 2001-01-22 05:16:24 +0000 |
---|---|---|
committer | Achim Gottinger <achim@gentoo.org> | 2001-01-22 05:16:24 +0000 |
commit | e142fbc94c7e70d1639f0b671c3d5ea823bfe601 (patch) | |
tree | 42e280c522740db96a81132211ab4fab1b5d99f7 /net-misc/openssh/files | |
parent | *** empty log message *** (diff) | |
download | gentoo-2-e142fbc94c7e70d1639f0b671c3d5ea823bfe601.tar.gz gentoo-2-e142fbc94c7e70d1639f0b671c3d5ea823bfe601.tar.bz2 gentoo-2-e142fbc94c7e70d1639f0b671c3d5ea823bfe601.zip |
*** empty log message ***
Diffstat (limited to 'net-misc/openssh/files')
-rwxr-xr-x | net-misc/openssh/files/svc-sshd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/net-misc/openssh/files/svc-sshd b/net-misc/openssh/files/svc-sshd new file mode 100755 index 000000000000..dba8da5ff099 --- /dev/null +++ b/net-misc/openssh/files/svc-sshd @@ -0,0 +1,42 @@ +#!/bin/sh +#RCUPDATE:2 3 4:75:This line is required for script management + +. /etc/rc.d/config/functions + +SERVICE="svc-openssh" +opts="start stop" + +gen_keys() { + if [ ! -e /etc/ssh/ssh_host_key ] ; then + einfo "Generating Hostkey..." + /usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N '' + fi + if [ ! -e /etc/ssh/ssh_host_dsa_key ] ; then + einfo "Generating DSA-Hostkey..." + /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' + fi +} + +start() { + gen_keys + ebegin "Starting $SERVICE" + ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE} + eend $? +} + +stop() { + ebegin "Stopping $SERVICE" + if [ -e ${SVCDIR}/control/${SERVICE} ] + then + /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE} + rm ${SVCDIR}/control/${SERVICE} + fi + eend $? +} + +doservice ${@} + + + + + |