Updated SQL & redis checkResult comparison operators

This commit is contained in:
Asif Bacchus 2018-10-21 03:43:50 -06:00
parent 5da2183b2c
commit c9926d7c4d

View File

@ -545,7 +545,7 @@ echo -e "${op}${stamp} Dumping mailcow SQL database...${normal}" >> "$logFile"
docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > "$sqlDumpDir/$sqlDumpFile" >> "$logFile" 2>&1 docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > "$sqlDumpDir/$sqlDumpFile" >> "$logFile" 2>&1
checkResult=$(docker-compose exec mysql-mailcow echo "$?") checkResult=$(docker-compose exec mysql-mailcow echo "$?")
# verify sql dump was successful # verify sql dump was successful
if [ "$checkResult" -eq 0 ]; then if [ "$checkResult"=0 ]; then
echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \ echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \
>> "$logFile" >> "$logFile"
else else
@ -558,7 +558,7 @@ echo -e "${op}${stamp} Saving redis state information...${normal}" >> "$logFile"
docker-compose exec redis-mailcow redis-cli save >> "$logFile" 2>&1 docker-compose exec redis-mailcow redis-cli save >> "$logFile" 2>&1
checkResult=$(docker-compose exec redis-mailcow echo "$?") checkResult=$(docker-compose exec redis-mailcow echo "$?")
# Verify save was successful # Verify save was successful
if [ "$checkResult" -eq 0 ]; then if [ "$checkResult"=0 ]; then
echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \ echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \
>> "$logFile" >> "$logFile"
else else