diff --git a/install-freedombone.sh b/install-freedombone.sh index c43cec3b..b4511534 100755 --- a/install-freedombone.sh +++ b/install-freedombone.sh @@ -155,7 +155,6 @@ REDMATRIX_FREEDNS_SUBDOMAIN_CODE= REDMATRIX_REPO="https://github.com/friendica/red.git" REDMATRIX_ADDONS_REPO="https://github.com/friendica/red-addons.git" REDMATRIX_ADMIN_PASSWORD= -REDMATRIX_INSTALLED="no" # Domain name or freedns subdomain for Owncloud installation OWNCLOUD_DOMAIN_NAME= @@ -497,7 +496,7 @@ function create_backup_script { echo 'echo "Obtaining GNU Social database backup"' >> /usr/bin/$BACKUP_SCRIPT_NAME echo "mysqldump --password=$MARIADB_PASSWORD gnusocial > /home/$MY_USERNAME/tempfiles/gnusocial.sql" >> /usr/bin/$BACKUP_SCRIPT_NAME fi - if [[ $REDMATRIX_INSTALLED == "yes" ]]; then + if grep -Fxq "install_redmatrix" $COMPLETION_FILE; then echo 'echo "Obtaining Red Matrix database backup"' >> /usr/bin/$BACKUP_SCRIPT_NAME echo "mysqldump --password=$MARIADB_PASSWORD redmatrix > /home/$MY_USERNAME/tempfiles/redmatrix.sql" >> /usr/bin/$BACKUP_SCRIPT_NAME fi @@ -660,7 +659,7 @@ function create_restore_script { echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME fi - if [[ $REDMATRIX_INSTALLED == "yes" ]]; then + if grep -Fxq "install_redmatrix" $COMPLETION_FILE; then echo "if [ -f /home/$MY_USERNAME/tempfiles/redmatrix.sql ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' echo "Restoring Red Matrix database"' >> /usr/bin/$RESTORE_SCRIPT_NAME echo " mysql -u root --password=$MARIADB_PASSWORD redmatrix -o < /home/$MY_USERNAME/tempfiles/redmatrix.sql" >> /usr/bin/$RESTORE_SCRIPT_NAME @@ -761,7 +760,7 @@ function backup_to_friends_servers { echo " mysqldump --password=$MARIADB_PASSWORD gnusocial > /home/$MY_USERNAME/tempfiles/gnusocial.sql" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME fi - if [[ $REDMATRIX_INSTALLED == "yes" ]]; then + if grep -Fxq "install_redmatrix" $COMPLETION_FILE; then echo 'if [ -f /var/backups/redmatrix_daily.sql ]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo " cp /var/backups/redmatrix_daily.sql /home/$MY_USERNAME/tempfiles/redmatrix.sql" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'else' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME @@ -945,7 +944,7 @@ function restore_from_friend { echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME fi - if [[ $REDMATRIX_INSTALLED == "yes" ]]; then + if grep -Fxq "install_redmatrix" $COMPLETION_FILE; then echo "if [ -f /home/$MY_USERNAME/tempfiles/redmatrix.sql ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' echo "Restoring Red Matrix database"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo " mysql -u root --password=$MARIADB_PASSWORD redmatrix -o < /home/$MY_USERNAME/tempfiles/redmatrix.sql" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME @@ -4231,7 +4230,6 @@ quit" > $INSTALL_DIR/batch.sql chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README fi - REDMATRIX_INSTALLED="yes" echo 'install_redmatrix' >> $COMPLETION_FILE }