Tidying restore script

This commit is contained in:
Bob Mottram 2015-09-25 22:54:23 +01:00
parent e455f557a1
commit b2bc96f5e5
1 changed files with 5 additions and 5 deletions

View File

@ -2907,7 +2907,6 @@ function restore_directory_from_usb {
function restore_database { function restore_database {
echo 'function restore_database {' >> /usr/bin/$RESTORE_SCRIPT_NAME echo 'function restore_database {' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo " DATABASE_PASSWORD=\"$DATABASE_PASSWORD\"" >> /usr/bin/$RESTORE_SCRIPT_NAME
if [[ $BACKUP_TYPE == 'obnam' ]]; then if [[ $BACKUP_TYPE == 'obnam' ]]; then
echo ' RESTORE_SUBDIR="root"' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' RESTORE_SUBDIR="root"' >> /usr/bin/$RESTORE_SCRIPT_NAME
else else
@ -3028,6 +3027,11 @@ function create_restore_script {
echo 'cp -r /home/$MY_USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_SCRIPT_NAME echo 'cp -r /home/$MY_USERNAME/.gnupg /root' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '# MariaDB password' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo -n 'DATABASE_PASSWORD=$(cat ' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo "$DATABASE_PASSWORD_FILE)" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
restore_directory_from_usb restore_directory_from_usb
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
restore_database restore_database
@ -3063,10 +3067,6 @@ function create_restore_script {
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
fi fi
echo '# MariaDB password' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo -n 'DATABASE_PASSWORD=$(cat ' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo "$DATABASE_PASSWORD_FILE)" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '# Make a backup of the original README file' >> /usr/bin/$RESTORE_SCRIPT_NAME echo '# Make a backup of the original README file' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '# incase old passwords need to be used' >> /usr/bin/$RESTORE_SCRIPT_NAME echo '# incase old passwords need to be used' >> /usr/bin/$RESTORE_SCRIPT_NAME