mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-26 19:42:55 +08:00
11 lines
295 B
Bash
11 lines
295 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
|
|
# 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 || true
|