diff --git a/scripts/restart-services.sh b/scripts/restart-services.sh index eac5494..00ec8d8 100755 --- a/scripts/restart-services.sh +++ b/scripts/restart-services.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [[ $EUID -ne 0 ]]; then + exec sudo "$0" "$@" + exit 0 +fi + echo "systemctl restart nginx" systemctl restart nginx sleep 1 @@ -22,3 +27,5 @@ if [ "$failed" -eq 1 ]; then exit 1 fi +exit 0 +