. /etc/sysconfig/network
# Check that networking is up
-if is_no "${NETWORKING}"; then
- msg_network_down auth2
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down auth2
+ exit 1
+ fi
+else
+ exit 0
fi
+RETVAL=0
case "$1" in
- start)
- # Check if the service is already running?
- if [ -f /var/lock/subsys/auth2 ]; then
- msg_already_running auth2
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/auth2 ]; then
+ msg_starting auth2
+ daemon auth2
+ RETVAL=$?
+ [ RETVAL -eq 0 ] && touch /var/lock/subsys/auth2
else
- msg_starting auth2
- daemon auth2
- RETVAL=$?
- [ RETVAL -eq 0 ] && touch /var/lock/subsys/auth2
+ msg_already_running auth2
fi
- ;;
- stop)
- if [ -f /var/lock/subsys/auth2 ]; then
- msg_stopping auth2
- killproc auth2
- rm -f /var/lock/subsys/auth2
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/auth2 ]; then
+ msg_stopping auth2
+ killproc auth2
+ rm -f /var/lock/subsys/auth2
else
- msg_Not_Running auth2
+ msg_not_running auth2
fi
- ;;
- restart)
- $0 stop
+ ;;
+ status)
+ status auth2
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
$0 start
- ;;
- *)
- msg_usage "$0 {start|stop|restart}"
- exit 1
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
;;
esac
exit $RETVAL
-