From: Philipp Skadorov Date: Wed, 8 Mar 2017 20:43:31 +0000 (-0500) Subject: lighttpd: carry common keywords out to variables X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7bee455bd805d19f0b591dfecb87d90ff64af571;p=buildroot.git lighttpd: carry common keywords out to variables S50lighttpd contains repeating keywords that are worth carrying out as variables: pid file name, daemon name, config file name. Signed-off-by: Philipp Skadorov Signed-off-by: Thomas Petazzoni --- diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd index 44ac257c18..7a14ec8a90 100644 --- a/package/lighttpd/S50lighttpd +++ b/package/lighttpd/S50lighttpd @@ -2,15 +2,19 @@ # # Starts lighttpd. # +NAME=lighttpd +DAEMON=/usr/sbin/$NAME +PID_FILE="/var/run/$NAME.pid" +CONF_FILE="/etc/$NAME/$NAME.conf" start() { printf "Starting lighttpd: " - start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf + start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE echo "OK" } stop() { printf "Stopping lighttpd: " - start-stop-daemon -K -q -p /var/run/lighttpd.pid + start-stop-daemon -K -q -p $PID_FILE echo "OK" } restart() {