From 7bee455bd805d19f0b591dfecb87d90ff64af571 Mon Sep 17 00:00:00 2001 From: Philipp Skadorov Date: Wed, 8 Mar 2017 15:43:31 -0500 Subject: [PATCH] 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 --- package/lighttpd/S50lighttpd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() { -- 2.30.2