X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage3%2Fbootscripts%2Fsshd;h=1d3ab9fa8804917135985bd9da9ffd87bdef5984;hb=8736214ae0db4817212fd150fa2da1dc2e866c4a;hp=83e4349b9631c5fa656c9fe578bd4d5093bf3aa2;hpb=be41960e19c9daee738916df4138559a262ca34a;p=hvlinux.git diff --git a/stage3/bootscripts/sshd b/stage3/bootscripts/sshd index 83e4349..1d3ab9f 100755 --- a/stage3/bootscripts/sshd +++ b/stage3/bootscripts/sshd @@ -5,9 +5,18 @@ # Source functions library source /etc/rc.d/init.d/functions +source /etc/sysconfig/network/network-parameters + log_script_name "$0 $*" -SSHD="/usr/sbin/sshd -4" +DAEMON="/usr/sbin/sshd" +DAEMON_DESC="SSH server" +DAEMON_OPTS="-4" + +# Check if SSH server is desired +if [ "x${SSH_SERVER_ENA}" != "xyes" -a "x${SSH_SERVER_ENA}" != "xYes" -a "x${SSH_SERVER_ENA}" != "xYES" ]; then + exit ${EXIT_CODE_SUCCESS} +fi gen_keys() { if [ ! -e /etc/ssh/ssh_host_key ] ; then @@ -33,28 +42,28 @@ sshd_start() { fi gen_keys - + if [ $? -ne 0 ]; then exit ${EXIT_CODE_FAILURE} else - loadproc ${SSHD} + loadproc ${DAEMON} ${DAEMON_OPTS} fi } # See how we were called case "$1" in start) - cmd_run_log_box_warn "sshd start" sshd_start + cmd_run_log_box_warn "${DAEMON_DESC} start" sshd_start ;; - + stop) - cmd_run_log_box_warn "sshd stop" killproc sshd + cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON} ;; - + reload) - reloadproc sshd + reloadproc ${DAEMON} ;; - + restart) $0 stop sleep 1 @@ -62,9 +71,9 @@ case "$1" in ;; status) - statusproc sshd + statusproc ${DAEMON} ;; - + *) echo "Usage: $0 {reload|restart|start|status|stop}" exit ${EXIT_CODE_FAILURE}