Check if service unit is present before trying to restart it
This commit is contained in:
parent
50a5082089
commit
120fc846c5
1 changed files with 2 additions and 1 deletions
|
@ -6,4 +6,5 @@
|
|||
#
|
||||
|
||||
SERVICE=$1
|
||||
/usr/bin/systemctl try-restart $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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue