-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
192 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
#!/usr/bin/env bash | ||
# Redémarrage des services post-mise à jour | ||
# Restart services after update | ||
|
||
function restartService | ||
{ | ||
# Si $SERVICE_TO_BE_RESTARTED contient des services nécessitant un redémarrage, on traite | ||
if [ ! -z "$SERVICE_TO_BE_RESTARTED" ];then | ||
OLD_IFS=$IFS | ||
IFS=' ' | ||
# If $SERVICE_TO_BE_RESTARTED contains services that need to be restarted | ||
if [ -z "$SERVICE_TO_BE_RESTARTED" ];then | ||
return | ||
fi | ||
|
||
for SERVICE in $(echo "$SERVICE_TO_BE_RESTARTED"); do | ||
SERVICE=$(echo "$SERVICE" | sed 's/ //g') | ||
echo -ne "→ Restarting ${YELLOW}${SERVICE}${RESET} service: " | ||
systemctl restart "$SERVICE" --quiet | ||
if [ "$?" != "0" ];then | ||
echo -e "[$YELLOW ERROR $RESET] while restarting" | ||
else | ||
echo -e "[$GREEN OK $RESET]" | ||
fi | ||
done | ||
OLD_IFS=$IFS | ||
IFS=' ' | ||
|
||
IFS=$OLD_IFS | ||
fi | ||
for SERVICE in $(echo "$SERVICE_TO_BE_RESTARTED"); do | ||
# Clean eventual spaces | ||
SERVICE=$(echo "$SERVICE" | sed 's/ //g') | ||
|
||
echo -ne "→ Restarting ${YELLOW}${SERVICE}${RESET} service: " | ||
|
||
systemctl restart "$SERVICE" --quiet | ||
|
||
if [ "$?" != "0" ];then | ||
echo -e "[$YELLOW ERROR $RESET] while restarting" | ||
else | ||
echo -e "[$GREEN OK $RESET]" | ||
fi | ||
done | ||
|
||
IFS=$OLD_IFS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.