diff --git a/src/freedombone b/src/freedombone index d7a83ff3..de248b13 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1551,6 +1551,7 @@ function create_backup_script { get_mariadb_gnusocial_admin_password get_mariadb_redmatrix_admin_password get_mariadb_owncloud_admin_password + get_mariadb_git_admin_password echo '#!/bin/bash' > /usr/bin/$BACKUP_SCRIPT_NAME echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME @@ -1765,8 +1766,8 @@ function create_backup_script { echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME echo 'shred -zu /root/tempgogsdata/*' >> /usr/bin/$BACKUP_SCRIPT_NAME echo 'rm -rf /root/tempgogsdata' >> /usr/bin/$BACKUP_SCRIPT_NAME - echo 'echo "Obtaining Gogs data backup"' >> /usr/bin/$BACKUP_SCRIPT_NAME - echo "rsyncrypto -v -r /home/git/go/src/github.com/gogits/gogs $USB_MOUNT/backup/gogs $USB_MOUNT/backup/gogs.keys $BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_SCRIPT_NAME + echo 'echo "Obtaining Gogs settings backup"' >> /usr/bin/$BACKUP_SCRIPT_NAME + echo "rsyncrypto -v -r /home/git/go/src/github.com/gogits/gogs/custom $USB_MOUNT/backup/gogs $USB_MOUNT/backup/gogs.keys $BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_SCRIPT_NAME echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME echo " umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME @@ -2587,12 +2588,15 @@ function create_restore_script { echo " rm -rf $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' exit 965' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME - echo ' echo "Restoring Gogs installation"' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' echo "Restoring Gogs settings"' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' if [ ! -d /root/tempgogs ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' mkdir /root/tempgogs' >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME echo " rsyncrypto -v -d -r $USB_MOUNT/backup/gogs /root/tempgogs $USB_MOUNT/backup/gogs.keys $BACKUP_CERTIFICATE" >> /usr/bin/$RESTORE_SCRIPT_NAME - echo " cp -r /root/tempgogs/usb/backup/gogs/git/go/src/github.com/gogits/gogs/* /home/git/go/src/github.com/gogits/gogs/" >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' if [ ! -d /home/git/go/src/github.com/gogits/gogs/custom ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' mkdir -p /home/git/go/src/github.com/gogits/gogs/custom' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME + echo " cp -r /root/tempgogs/usb/backup/gogs/git/go/src/github.com/gogits/gogs/custom/* /home/git/go/src/github.com/gogits/gogs/custom" >> /usr/bin/$RESTORE_SCRIPT_NAME echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME echo " umount $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME echo " rm -rf $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME @@ -3084,12 +3088,12 @@ function backup_to_friends_servers { echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'shred -zu /root/tempgogsdata/*' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'rm -rf /root/tempgogsdata' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME - echo 'echo "Obtaining Gogs data backup"' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME - echo -n 'rsyncrypto -v -r /home/git/go/src/github.com/gogits/gogs $SERVER_DIRECTORY/backup/gogs $SERVER_DIRECTORY/backup/gogs.keys ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME + echo 'echo "Obtaining Gogs settings backup"' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME + echo -n 'rsyncrypto -v -r /home/git/go/src/github.com/gogits/gogs/custom $SERVER_DIRECTORY/backup/gogs $SERVER_DIRECTORY/backup/gogs.keys ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo "$BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo ' # Send a warning email' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME - echo -n ' echo "Unable to encrypt gogs installation (/home/git/go/src/github.com/gogits/gogs)" | mail -s "Freedombone backup to friends" ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME + echo -n ' echo "Unable to encrypt gogs installation (/home/git/go/src/github.com/gogits/gogs/custom)" | mail -s "Freedombone backup to friends" ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo "$MY_EMAIL_ADDRESS" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo ' exit 76547' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME @@ -3985,13 +3989,16 @@ function restore_from_friend { echo ' echo "$mysqlsuccess"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' exit 3695' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME - echo ' echo "Restoring Gogs installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' echo "Restoring Gogs settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' if [ ! -d /root/tempgogs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' mkdir /root/tempgogs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo -n ' rsyncrypto -v -d -r $SERVER_DIRECTORY/backup/gogs /root/tempgogs $SERVER_DIRECTORY/backup/gogs.keys ' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo "$BACKUP_CERTIFICATE" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME - echo " cp -r /root/tempgogs/remoterestore/backup/gogs/git/go/src/github.com/gogits/gogs/* /home/git/go/src/github.com/gogits/gogs/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' if [ ! -d /home/git/go/src/github.com/gogits/gogs/custom ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' mkdir -p /home/git/go/src/github.com/gogits/gogs/custom' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME + echo " cp -r /root/tempgogs/remoterestore/backup/gogs/git/go/src/github.com/gogits/gogs/custom/* /home/git/go/src/github.com/gogits/gogs/custom/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' exit 5885' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME