Exit on mysql command failure
This commit is contained in:
parent
e56daa5f7f
commit
af3d6a14de
|
@ -915,7 +915,11 @@ function create_restore_script {
|
|||
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' BACKUP_MARIADB_PASSWORD=$(</root/tempmariadb/usb/backup/mariadb/tempmariadb/db)' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' echo "Restore the MariaDB user table"' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' mysql -u root --password=$DATABASE_PASSWORD mysql -o < /root/tempmariadb/usb/backup/mariadb/tempmariadb/mysql.sql' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' mysqlsuccess=$(mysql -u root --password=$DATABASE_PASSWORD mysql -o < /root/tempmariadb/usb/backup/mariadb/tempmariadb/mysql.sql)' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' if [ ! "$mysqlsuccess" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' echo "$mysqlsuccess"' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' exit 962' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' shred -zu /root/tempmariadb/usb/backup/mariadb/tempmariadb/db' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' rm -rf /root/tempmariadb' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
echo ' echo "Apply the new MariaDB user table"' >> /usr/bin/$RESTORE_SCRIPT_NAME
|
||||
|
|
Loading…
Reference in New Issue