Changed exit codes for consistency rather than script order.
This commit is contained in:
parent
fcd7a4ae6c
commit
ad972f1c71
@ -93,7 +93,7 @@ logFile=/var/log/borgbackup.log
|
|||||||
# echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] This script MUST" \
|
# echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] This script MUST" \
|
||||||
# "be run as ROOT."
|
# "be run as ROOT."
|
||||||
# echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m"
|
# echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m"
|
||||||
# exit 100
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
|
|
||||||
@ -180,9 +180,10 @@ sudo -u ${webUser} php "${ncroot}/occ maintenance:mode --on" 2>> $logFile
|
|||||||
if [ "$?" = "0" ]; then
|
if [ "$?" = "0" ]; then
|
||||||
echo -e "\e[0;36m...done\e[0m" >> $logFile
|
echo -e "\e[0;36m...done\e[0m" >> $logFile
|
||||||
else
|
else
|
||||||
echo -e "\e[1;33m--Warning-- There was a problem putting NextCloud" \
|
echo -e "\e[1;31m--Error-- There was a problem putting NextCloud" \
|
||||||
"into maintenance mode" >> $logFile
|
"into maintenance mode" >> $logFile
|
||||||
echo -e "\e[1;39mScript will continue..." >> $logFile
|
echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" >> $logFile
|
||||||
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Read sqlDetails file and extract necessary information
|
## Read sqlDetails file and extract necessary information
|
||||||
@ -198,4 +199,8 @@ if [ "$?" = "0" ]; then
|
|||||||
else
|
else
|
||||||
echo -e "\e[1;31m--Error-- There was a problem dumping SQL." >> $logFile
|
echo -e "\e[1;31m--Error-- There was a problem dumping SQL." >> $logFile
|
||||||
echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" >> $logFile
|
echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" >> $logFile
|
||||||
|
exit 102
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Gracefully exit
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user