Do exit with 1 in case service is not present while running conditional-restart.sh.

This commit is contained in:
Jan Kaluža 2018-03-07 08:57:58 +00:00
parent 4017e9ebdc
commit f5760b6f5e

View file

@ -7,4 +7,4 @@
SERVICE=$1
# Check if service unit is present before trying to restart it
/usr/bin/systemctl cat $1.service &>/dev/null && /usr/bin/systemctl try-restart $1
/usr/bin/systemctl cat $1.service &>/dev/null && /usr/bin/systemctl try-restart $1 || true