Script apache.sh

From campisano.org
Jump to navigation Jump to search
#!/bin/sh
#
# apache.sh



### BEGIN INIT INFO
# Provides:          apache
# Required-Start:    $network
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop Apache web server
### END INIT INFO



PATH=/"sbin:/bin:/usr/sbin:/usr/bin";

COMMAND="/srv/local/apache/bin/apachectl";
ARG_START="-k start";
ARG_STOP="-k stop";



case "$1" in
    start)
        $COMMAND ${ARG_START};
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2;
        exit 3;
        ;;
    stop)
        $COMMAND ${ARG_STOP};
        ;;
    *)
        echo "Usage: {command} [start|stop]" >&2;
        exit 3;
        ;;
esac



# End