From: Francois Fleuret Date: Sun, 26 Apr 2009 20:19:26 +0000 (+0200) Subject: Cosmetics + added a check for the existence of the configuration file. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=cad86f937dd0996d68d01fd579b084c6a2cb5d33;p=breezed.git Cosmetics + added a check for the existence of the configuration file. --- diff --git a/breezed.sh b/breezed.sh index 255386b..5de38f6 100755 --- a/breezed.sh +++ b/breezed.sh @@ -2,7 +2,7 @@ # breezed is a fan speed control daemon for Linux computers. # -# Copyright (c) 2008 Francois Fleuret +# Copyright (c) 2008, 2009 Francois Fleuret # Written by Francois Fleuret # # This file is part of breezed. @@ -29,6 +29,7 @@ ### END INIT INFO DAEMON="/usr/local/bin/breezed" +CONF_FILE="/etc/breezed.conf" test -x $DAEMON || exit 0 @@ -37,11 +38,15 @@ test -x $DAEMON || exit 0 case "$1" in start) - log_daemon_msg "Starting fan control daemon" "breezed" - start-stop-daemon --start --background --quiet \ - --make-pidfile --pidfile /var/run/breezed.pid \ - --exec ${DAEMON} - log_end_msg $? + if [[ -f "${CONF_FILE}" ]]; then + log_daemon_msg "Starting fan control daemon" "breezed" + start-stop-daemon --start --background --quiet \ + --make-pidfile --pidfile /var/run/breezed.pid \ + --exec ${DAEMON} + log_end_msg $? + else + log_failure_msg "Can not find ${CONF_FILE}." + fi ;; restart)