# Source function library
. /etc/rc.d/init.d/functions
-upstart_controlled --except init configtest
-
# Get network config
. /etc/sysconfig/network
start() {
# Check if the service is already running?
- if [ -f /var/lock/subsys/sshd ]; then
+ if status --pidfile $PIDFILE sshd >/dev/null; then
msg_already_running "OpenSSH"
return
fi
checkconfig
- if [ ! -s /etc/ssh/ssh_host_key ]; then
+ if [ "$(echo /etc/ssh/ssh_host*key)" = "/etc/ssh/ssh_host*key" ]; then
msg_not_running "OpenSSH"
nls "No SSH host key found! You must run \"%s init\" first." "$0"
exit 1