fix init system detection

This commit is contained in:
Pascal Vizeli 2017-04-23 23:40:38 +02:00
parent ec1a0fd2c8
commit d040a9b6c8
2 changed files with 3 additions and 2 deletions

View file

@ -19,11 +19,12 @@ command -v socat > /dev/null 2>&1 || { echo "[ERROR] Please install socat first"
command -v curl > /dev/null 2>&1 || { echo "[ERROR] Please install curl first"; exit 1; }
# Check system options
if [ command -v systemctl > /dev/null 2>&1 ]; then
if [ -x $(command -v systemctl) ]; then
INIT_SYSTEM=systemd
else
INIT_SYSTEM=sysvinit
echo "[ERROR] Only systemd is supprted at the moment"
exit 1
fi
# Parse command line parameters