Laravel_pc_lycee/scripts/restart-webserver.sh

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