3 # rc.darkhttpd: Start/Stop the darkhttpd web server
5 # This script assumes you have darkhttpd installed and available in the PATH.
6 # Configuration can be placed in /etc/defaults/darkhttpd
8 # config file /etc/default/darkhttpd:
9 CONFIG_FILE
="/etc/default/darkhttpd"
11 # Load options from /etc/default/darkhttpd:
12 # Source the configuration file if it exists
13 if [ -f "$CONFIG_FILE" ]; then
17 # Function to start darkhttpd
19 if pgrep
-x darkhttpd
> /dev
/null
; then
20 echo "darkhttpd is already running."
22 echo "Starting darkhttpd..."
23 $DARKHTTPD_BIN $DARKHTTPD_ROOT $DARKHTTPD_FLAGS
25 echo "darkhttpd started."
27 echo "Failed to start darkhttpd."
32 # Function to stop darkhttpd
34 echo "Stopping darkhttpd..."
37 echo "darkhttpd stopped."
39 echo "Failed to stop darkhttpd or it was not running."
43 # Function to restart darkhttpd
50 # Check for input argument
62 echo "Usage: $0 {start|stop|restart}"