diff --git a/src/freedombone b/src/freedombone index c84d9ece..7d21d55b 100755 --- a/src/freedombone +++ b/src/freedombone @@ -7538,6 +7538,11 @@ function repair_databases_script { echo '' >> /usr/bin/repairdatabase echo 'DATABASE=$1' >> /usr/bin/repairdatabase echo "EMAIL=$MY_EMAIL_ADDRESS" >> /usr/bin/repairdatabase + echo "BACKUP_TYPE='daily'" >> /usr/bin/repairdatabase + echo '' >> /usr/bin/repairdatabase + echo 'if [ $2 ]; then' >> /usr/bin/repairdatabase + echo ' BACKUP_TYPE=$2' >> /usr/bin/repairdatabase + echo 'fi' >> /usr/bin/repairdatabase echo '' >> /usr/bin/repairdatabase echo -n 'MYSQL_ROOT_PASSWORD=$(cat ' >> /usr/bin/repairdatabase echo "$DATABASE_PASSWORD_FILE)" >> /usr/bin/repairdatabase @@ -7563,7 +7568,7 @@ function repair_databases_script { echo '' >> /usr/bin/repairdatabase echo '# If it still contains errors then restore from backup' >> /usr/bin/repairdatabase echo 'if grep -q "Error" "$TEMPFILE"; then' >> /usr/bin/repairdatabase - echo ' mysql -u root --password=$MYSQL_ROOT_PASSWORD $DATABASE -o < /var/backups/${DATABASE}_daily.sql' >> /usr/bin/repairdatabase + echo ' mysql -u root --password=$MYSQL_ROOT_PASSWORD $DATABASE -o < /var/backups/${DATABASE}_${BACKUP_TYPE}.sql' >> /usr/bin/repairdatabase echo '' >> /usr/bin/repairdatabase echo ' # Send a warning email' >> /usr/bin/repairdatabase echo ' echo "$DATABASE database corruption could not be repaired. Restored from backup." | mail -s "Freedombone database maintenance" $EMAIL' >> /usr/bin/repairdatabase