Also backup the tox node configuration file

This commit is contained in:
Bob Mottram 2015-07-11 15:01:21 +01:00
parent 8861ffe686
commit 88709ff42a
1 changed files with 16 additions and 0 deletions

View File

@ -2326,6 +2326,7 @@ function create_backup_script {
echo " if [ ! -d $USB_MOUNT/backup/tox ]; then" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " mkdir -p $USB_MOUNT/backup/tox" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " cp /etc/tox-bootstrapd.conf /var/lib/tox-bootstrapd" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " rsyncrypto -v -r /var/lib/tox-bootstrapd $USB_MOUNT/backup/tox $USB_MOUNT/backup/tox.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
@ -3038,6 +3039,14 @@ function create_restore_script {
echo " rm -rf $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' exit 6393' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' cp /var/lib/tox-bootstrapd/tox-bootstrapd.conf /etc/tox-bootstrapd.conf' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' systemctl restart tox-bootstrapd.service' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' systemctl status tox-bootstrapd.service' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo " umount $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo " rm -rf $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' exit 59369' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
@ -3801,6 +3810,7 @@ function backup_to_friends_servers {
echo ' if [ ! -d $SERVER_DIRECTORY/backup/tox ]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo ' mkdir -p $SERVER_DIRECTORY/backup/tox' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo ' cp /etc/tox-bootstrapd.conf /var/lib/tox-bootstrapd' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n " rsyncrypto -v -r /var/lib/tox-bootstrapd " >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n '$SERVER_DIRECTORY/backup/tox $SERVER_DIRECTORY/backup/tox.keys ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "$BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
@ -4553,6 +4563,12 @@ function restore_from_friend {
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' exit 93653' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' cp /var/lib/tox-bootstrapd/tox-bootstrapd.conf /etc/tox-bootstrapd.conf' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' systemctl restart tox-bootstrapd.service' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' systemctl status tox-bootstrapd.service' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' exit 59369' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo ' fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME