From 155868d75ac1eceeb905b9e74e013cc7a653ffd7 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 4 Mar 2018 23:51:56 +0800 Subject: web: acme deploy check service running status --- roles/web/files/deploy.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'roles/web') 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 -- cgit v1.2.2