Laravel_pc_perso/scripts/restart-webserver.sh
2024-06-12 13:02:54 +02:00

14 lines
249 B
Bash

#!/usr/bin/env bash
# Restart whichever web server isn't disabled
# is nginx enabled?
OUTPUT="$(systemctl is-enabled nginx)"
if [ "$OUTPUT" == "enabled" ]; then
service nginx restart
else
service nginx stop
service apache2 restart
fi