2014-03-14 15:30:32 +00:00
|
|
|
#!/bin/bash
|
2018-02-20 00:24:11 +00:00
|
|
|
#
|
|
|
|
# We use this to try and restart a service.
|
|
|
|
# If it's not running, do nothing.
|
|
|
|
# If it is running, restart it.
|
|
|
|
#
|
2014-03-14 15:30:32 +00:00
|
|
|
|
|
|
|
SERVICE=$1
|
2018-02-22 09:35:08 +00:00
|
|
|
# Check if service unit is present before trying to restart it
|
2018-03-07 08:57:58 +00:00
|
|
|
/usr/bin/systemctl cat $1.service &>/dev/null && /usr/bin/systemctl try-restart $1 || true
|