diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-04 23:51:56 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-14 11:35:08 +0800 |
commit | 155868d75ac1eceeb905b9e74e013cc7a653ffd7 (patch) | |
tree | f9e2a2dcbafad349efa6cb867e549df8696dfe83 /roles/web/files/deploy.sh | |
parent | cf3668c339848240565deee9ae003d9c5e955893 (diff) | |
download | ansible-dfly-vps-155868d75ac1eceeb905b9e74e013cc7a653ffd7.tar.bz2 |
web: acme deploy check service running status
Diffstat (limited to 'roles/web/files/deploy.sh')
-rwxr-xr-x | roles/web/files/deploy.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/web/files/deploy.sh b/roles/web/files/deploy.sh index 6c503d6..9c6fff2 100755 --- a/roles/web/files/deploy.sh +++ b/roles/web/files/deploy.sh @@ -12,6 +12,10 @@ SERVICES="nginx dovecot postfix" for srv in ${SERVICES}; do - echo "ACME deploy: restarting ${srv} ..." - service ${srv} restart + if service ${srv} status >/dev/null 2>&1; then + echo "ACME deploy: restarting ${srv} ..." + service ${srv} restart + else + echo "ACME deploy: service ${srv} not running" + fi done |