Just change the conditional script to use systemctl try-restart and hopefully it will do what we want.
9 lines
175 B
Bash
9 lines
175 B
Bash
#!/bin/bash
|
|
#
|
|
# We use this to try and restart a service.
|
|
# If it's not running, do nothing.
|
|
# If it is running, restart it.
|
|
#
|
|
|
|
SERVICE=$1
|
|
/usr/bin/systemctl try-restart $1
|