From 7af0029175c03814de5466cccce04da2bd5fa603 Mon Sep 17 00:00:00 2001 From: bcambl Date: Sun, 1 May 2016 08:45:41 -0600 Subject: [PATCH] check for systemctl for systemd service management --- automated install/basic-install.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index cd16ca5c..a346edd4 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -544,7 +544,11 @@ stopServices() { $SUDO echo ":::" $SUDO echo -n "::: Stopping services..." #$SUDO service dnsmasq stop & spinner $! || true - $SUDO service lighttpd stop & spinner $! || true + if [ -x "$(command -v systemctl)" ]; then + $SUDO systemctl stop lighttpd & spinner $! || true + else + $SUDO service lighttpd stop & spinner $! || true + fi $SUDO echo " done." } @@ -796,8 +800,15 @@ displayFinalMessage echo -n "::: Restarting services..." # Start services -$SUDO service dnsmasq restart -$SUDO service lighttpd start + +if [ -x "$(command -v systemctl)" ]; then + $SUDO systemctl restart dnsmasq + $SUDO systemctl start lighttpd +else + $SUDO service dnsmasq restart + $SUDO service lighttpd start +fi + echo " done." echo ":::"