#!/bin/bash
### BEGIN INIT INFO
# Provides: hmcsshd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Wrapper script for starting sshd
# Description: Allow ssh services to be enabled/disabled.
### END INIT INFO

. /etc/rc.status
export PATH=/usr/sbin:/sbin:$PATH
rc_reset

case "$1" in
	start)
		if [ -f /opt/hsc/data/.ssh_enabled ]
		then
		   /etc/rc.d/sshd start
	        fi
	        rc_status -v
		;;
	stop)
		/etc/rc.d/sshd stop
	        rc_status -v
		;;
	force_start)
		/etc/rc.d/sshd start
		touch /opt/hsc/data/.ssh_enabled
	        rc_status -v
		;;
	force_stop)
		/etc/rc.d/sshd stop
		rm -f /opt/hsc/data/.ssh_enabled
	        rc_status -v
		;;
	restart)
		/etc/rc.d/sshd restart
	        rc_status -v
		;;
	status)
		/etc/rc.d/sshd status /usr/sbin/sshd
	        rc_status -v
		;;
	*)
		echo $"Usage: $0 {start|stop|force_start|force_stop|restart|status}"
		rc_failed 1
esac
rc_exit
