|  | @@ -4308,62 +4308,70 @@ function backup_to_friends_servers {
 | 
	
		
			
			| 4308 | 4308 |  }
 | 
	
		
			
			| 4309 | 4309 |  
 | 
	
		
			
			| 4310 | 4310 |  function restore_directory_from_friend {
 | 
	
		
			
			| 4311 |  | -  echo "  if [ ! -d ${1} ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4312 |  | -  echo "    mkdir ${1}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4311 | +  echo 'function restore_directory_from_friend {' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4312 | +  echo '  if [ ! -d ${1} ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4313 | +  echo '    mkdir ${1}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4313 | 4314 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4314 | 4315 |    if [[ $BACKUP_TYPE == 'obnam' ]]; then
 | 
	
		
			
			| 4315 | 4316 |        echo -n '  obnam restore -r $SERVER_DIRECTORY/backup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4316 |  | -      echo "${2} --to ${1}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4317 | +      echo '${2} --to ${1}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4317 | 4318 |    else
 | 
	
		
			
			|  | 4319 | +      echo "  BACKUP_CERTIFICATE=$BACKUP_CERTIFICATE" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4318 | 4320 |        echo -n '  rsyncrypto -v -d -r $SERVER_DIRECTORY/backup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4319 |  | -      echo -n "${2} ${1} " >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4321 | +      echo -n '${2} ${1} ' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4320 | 4322 |        echo -n '$SERVER_DIRECTORY/backup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4321 |  | -      echo "${2}.keys $BACKUP_CERTIFICATE" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4323 | +      echo '${2}.keys $BACKUP_CERTIFICATE' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4322 | 4324 |    fi
 | 
	
		
			
			|  | 4325 | +  echo '}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4323 | 4326 |  }
 | 
	
		
			
			| 4324 | 4327 |  
 | 
	
		
			
			| 4325 | 4328 |  function restore_database_from_friend {
 | 
	
		
			
			| 4326 |  | -  RESTORE_SUBDIR='root'
 | 
	
		
			
			| 4327 |  | -  if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4328 |  | -      RESTORE_SUBDIR="remoterestore/backup/${1}data"
 | 
	
		
			
			|  | 4329 | +  echo 'function restore_database_from_friend {' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4330 | +  echo "  DATABASE_PASSWORD=$DATABASE_PASSWORD" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4331 | +  if [[ $BACKUP_TYPE == 'obnam' ]]; then
 | 
	
		
			
			|  | 4332 | +      echo '  RESTORE_SUBDIR="root"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4333 | +  else
 | 
	
		
			
			|  | 4334 | +      echo '  RESTORE_SUBDIR="remoterestore/backup/${1}data"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4329 | 4335 |    fi
 | 
	
		
			
			| 4330 | 4336 |    echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4331 |  | -  echo "if [ -d $SERVER_DIRECTORY/backup/${1} ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4332 |  | -  echo "  echo \"Restoring ${1} database\"" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4333 |  | -  restore_directory_from_friend /root/temp${1}data ${1}data
 | 
	
		
			
			| 4334 |  | -  echo "  if [ ! -f /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/${1}.sql ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4335 |  | -  echo "    echo \"Unable to restore ${1} database\"" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4336 |  | -  echo "    rm -rf /root/temp${1}data" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4337 |  | -  echo '    exit 503' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4338 |  | -  echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4339 |  | -  echo -n '  mysqlsuccess=$(mysql -u root --password=$DATABASE_PASSWORD ' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4340 |  | -  echo "${1} -o < /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/${1}.sql)" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4341 |  | -  echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4342 |  | -  echo '    echo "$mysqlsuccess"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4343 |  | -  echo '    exit 964' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4344 |  | -  echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4345 |  | -  echo "  shred -zu /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/*" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4346 |  | -  echo "  rm -rf /root/temp${1}data" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4347 |  | -  echo "  echo \"Restoring ${1} installation\"" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4348 |  | -  restore_directory_from_friend /root/temp${1} ${1}
 | 
	
		
			
			| 4349 |  | -  RESTORE_SUBDIR='var'
 | 
	
		
			
			| 4350 |  | -  if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4351 |  | -      RESTORE_SUBDIR="remoterestore/backup/${1}"
 | 
	
		
			
			| 4352 |  | -  fi
 | 
	
		
			
			| 4353 |  | -  echo "  if [ ${1} ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4354 |  | -  echo "    if [ -d /var/www/${2}/htdocs ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4355 |  | -  echo "      rm -rf /var/www/${2}/htdocs" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4356 |  | -  echo "      mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4357 |  | -  echo '      if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4358 |  | -  echo '        exit 683' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4359 |  | -  echo '      fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4360 |  | -  echo '      # Ensure that the bundled SSL cert is being used' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4361 |  | -  echo "      if [ -f /etc/ssl/certs/${2}.bundle.crt ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4362 |  | -  echo "        sed -i 's|${2}.crt|${2}.bundle.crt|g' /etc/nginx/sites-available/${2}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4337 | +  echo '  if [ -d $SERVER_DIRECTORY/backup/${1} ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4338 | +  echo '    echo "Restoring ${1} database"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4339 | +  echo '    restore_directory_from_friend /root/temp${1}data ${1}data' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4340 | +  echo '    if [ ! -f /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/${1}.sql ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4341 | +  echo '      echo "Unable to restore ${1} database"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4342 | +  echo '      rm -rf /root/temp${1}data' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4343 | +  echo '      exit 503' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4344 | +  echo '    fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4345 | +  echo -n '    mysqlsuccess=$(mysql -u root --password=$DATABASE_PASSWORD ' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4346 | +  echo '${1} -o < /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/${1}.sql)' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4347 | +  echo '    if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4348 | +  echo '      echo "$mysqlsuccess"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4349 | +  echo '      exit 964' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4350 | +  echo '    fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4351 | +  echo '    shred -zu /root/temp${1}data/${RESTORE_SUBDIR}/temp${1}data/*' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4352 | +  echo '    rm -rf /root/temp${1}data' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4353 | +  echo '    echo "Restoring ${1} installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4354 | +  echo '    restore_directory_from_friend /root/temp${1} ${1}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4355 | +  if [[ $BACKUP_TYPE == 'obnam' ]]; then
 | 
	
		
			
			|  | 4356 | +      echo '    RESTORE_SUBDIR="var"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4357 | +  else
 | 
	
		
			
			|  | 4358 | +      echo '    RESTORE_SUBDIR="remoterestore/backup/${1}"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4359 | +  fi
 | 
	
		
			
			|  | 4360 | +  echo '    if [ ${1} ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4361 | +  echo '      if [ -d /var/www/${2}/htdocs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4362 | +  echo '        rm -rf /var/www/${2}/htdocs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4363 | +  echo '        mv /root/temp${1}/${RESTORE_SUBDIR}/www/${2}/htdocs /var/www/${2}/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4364 | +  echo '        if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4365 | +  echo '          exit 683' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4366 | +  echo '        fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4367 | +  echo '        # Ensure that the bundled SSL cert is being used' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4368 | +  echo '        if [ -f /etc/ssl/certs/${2}.bundle.crt ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4369 | +  echo '          sed -i "s|${2}.crt|${2}.bundle.crt|g" /etc/nginx/sites-available/${2}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4370 | +  echo '        fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4363 | 4371 |    echo '      fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4364 | 4372 |    echo '    fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4365 | 4373 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4366 |  | -  echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4374 | +  echo '}' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4367 | 4375 |  }
 | 
	
		
			
			| 4368 | 4376 |  
 | 
	
		
			
			| 4369 | 4377 |  function restore_from_friend {
 | 
	
	
		
			
			|  | @@ -4466,13 +4474,18 @@ function restore_from_friend {
 | 
	
		
			
			| 4466 | 4474 |    echo "$DATABASE_PASSWORD_FILE)" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4467 | 4475 |    echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4468 | 4476 |  
 | 
	
		
			
			|  | 4477 | +  restore_directory_from_friend
 | 
	
		
			
			|  | 4478 | +  echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4479 | +  restore_database_from_friend
 | 
	
		
			
			|  | 4480 | +  echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			|  | 4481 | +
 | 
	
		
			
			| 4469 | 4482 |    echo 'if [ -d $SERVER_DIRECTORY/backup/mariadb ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4470 | 4483 |    RESTORE_SUBDIR='root/'
 | 
	
		
			
			| 4471 | 4484 |    if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4472 | 4485 |        RESTORE_SUBDIR='remoterestore/backup/mariadb/'
 | 
	
		
			
			| 4473 | 4486 |    fi
 | 
	
		
			
			| 4474 | 4487 |    echo '  echo "Restoring mysql settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4475 |  | -  restore_directory_from_friend /root/tempmariadb mariadb
 | 
	
		
			
			|  | 4488 | +  echo '  restore_directory_from_friend /root/tempmariadb mariadb' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4476 | 4489 |    echo '  echo "Get the MariaDB password from the backup"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4477 | 4490 |    echo "  if [ ! -f /root/tempmariadb/${RESTORE_SUBDIR}tempmariadb/db ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4478 | 4491 |    echo '    echo "MariaDB password file not found"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4514,7 +4527,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4514 | 4527 |    fi
 | 
	
		
			
			| 4515 | 4528 |    echo 'if [ -d $SERVER_DIRECTORY/backup/mutt ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4516 | 4529 |    echo '  echo "Restoring Mutt settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4517 |  | -  restore_directory_from_friend /root/tempmutt mutt
 | 
	
		
			
			|  | 4530 | +  echo '  restore_directory_from_friend /root/tempmutt mutt' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4518 | 4531 |    echo -n "  if [ -f /root/tempmutt/${RESTORE_SUBDIR}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4519 | 4532 |    echo '$MY_USERNAME/tempbackup/.muttrc ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4520 | 4533 |    echo -n "    cp -f /root/tempmutt/${RESTORE_SUBDIR}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4539,7 +4552,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4539 | 4552 |    fi
 | 
	
		
			
			| 4540 | 4553 |    echo 'if [ -d $SERVER_DIRECTORY/backup/gnupg ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4541 | 4554 |    echo '  echo "Restoring gnupg settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4542 |  | -  restore_directory_from_friend /root/tempgnupg gnupg
 | 
	
		
			
			|  | 4555 | +  echo '  restore_directory_from_friend /root/tempgnupg gnupg' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4543 | 4556 |    echo -n "  cp -r /root/tempgnupg/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4544 | 4557 |    echo '$MY_USERNAME/.gnupg /home/$MY_USERNAME/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4545 | 4558 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4560,7 +4573,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4560 | 4573 |    fi
 | 
	
		
			
			| 4561 | 4574 |    echo 'if [ -d $SERVER_DIRECTORY/backup/procmail ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4562 | 4575 |    echo '  echo "Restoring procmail settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4563 |  | -  restore_directory_from_friend /root/tempprocmail procmail
 | 
	
		
			
			|  | 4576 | +  echo '  restore_directory_from_friend /root/tempprocmail procmail' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4564 | 4577 |    echo -n "  cp -f /root/tempprocmail/${RESTORE_SUBDIR}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4565 | 4578 |    echo '/$MY_USERNAME/tempbackup/.procmailrc /home/$MY_USERNAME/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4566 | 4579 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4577,7 +4590,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4577 | 4590 |    fi
 | 
	
		
			
			| 4578 | 4591 |    echo 'if [ -d $SERVER_DIRECTORY/backup/spamassassin ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4579 | 4592 |    echo '  echo "Restoring spamassassin settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4580 |  | -  restore_directory_from_friend /root/tempspamassassin spamassassin
 | 
	
		
			
			|  | 4593 | +  echo '  restore_directory_from_friend /root/tempspamassassin spamassassin' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4581 | 4594 |    echo -n "  cp -rf /root/tempspamassassin/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4582 | 4595 |    echo '$MY_USERNAME/.spamassassin /home/$MY_USERNAME/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4583 | 4596 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4594,7 +4607,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4594 | 4607 |    fi
 | 
	
		
			
			| 4595 | 4608 |    echo 'if [ -d $SERVER_DIRECTORY/backup/readme ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4596 | 4609 |    echo '  echo "Restoring README"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4597 |  | -  restore_directory_from_friend /root/tempreadme readme
 | 
	
		
			
			|  | 4610 | +  echo '  restore_directory_from_friend /root/tempreadme readme' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4598 | 4611 |    echo -n "  cp -f /root/tempreadme/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4599 | 4612 |    echo '$MY_USERNAME/tempbackup/README /home/$MY_USERNAME/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4600 | 4613 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4611,7 +4624,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4611 | 4624 |    fi
 | 
	
		
			
			| 4612 | 4625 |    echo 'if [ -d $SERVER_DIRECTORY/backup/ipfs ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4613 | 4626 |    echo '  echo "Restoring IPFS"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4614 |  | -  restore_directory_from_friend /root/tempipfs ipfs
 | 
	
		
			
			|  | 4627 | +  echo '  restore_directory_from_friend /root/tempipfs ipfs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4615 | 4628 |    echo -n "  cp -f /root/tempipfs/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4616 | 4629 |    echo '$MY_USERNAME/tempbackup/ipfs/* /home/$MY_USERNAME/.ipfs' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4617 | 4630 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4628,7 +4641,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4628 | 4641 |    fi
 | 
	
		
			
			| 4629 | 4642 |    echo 'if [ -d $SERVER_DIRECTORY/backup/ssh ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4630 | 4643 |    echo '  echo "Restoring ssh keys"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4631 |  | -  restore_directory_from_friend /root/tempssh ssh
 | 
	
		
			
			|  | 4644 | +  echo '  restore_directory_from_friend /root/tempssh ssh' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4632 | 4645 |    echo -n "  cp -r /root/tempssh/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4633 | 4646 |    echo '$MY_USERNAME/.ssh /home/$MY_USERNAME/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4634 | 4647 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4645,7 +4658,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4645 | 4658 |    fi
 | 
	
		
			
			| 4646 | 4659 |    echo 'if [ -d $SERVER_DIRECTORY/backup/ssl ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4647 | 4660 |    echo '  echo "Restoring certificates"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4648 |  | -  restore_directory_from_friend /root/tempssl ssl
 | 
	
		
			
			|  | 4661 | +  echo '  restore_directory_from_friend /root/tempssl ssl' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4649 | 4662 |    echo -n "  cp -r /root/tempssl/${RESTORE_SUBDIR}/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4650 | 4663 |    echo 'ssl/* /etc/ssl' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4651 | 4664 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4661,7 +4674,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4661 | 4674 |    fi
 | 
	
		
			
			| 4662 | 4675 |    echo 'if [ -d $SERVER_DIRECTORY/backup/projects ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4663 | 4676 |    echo '  echo "Restoring projects"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4664 |  | -  restore_directory_from_friend /root/tempprojects projects
 | 
	
		
			
			|  | 4677 | +  echo '  restore_directory_from_friend /root/tempprojects projects' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4665 | 4678 |    echo '  if [ -d /home/$MY_USERNAME/projects ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4666 | 4679 |    echo '    rm -rf /home/$MY_USERNAME/projects' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4667 | 4680 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4680,7 +4693,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4680 | 4693 |    fi
 | 
	
		
			
			| 4681 | 4694 |    echo 'if [ -d $SERVER_DIRECTORY/backup/personal ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4682 | 4695 |    echo '  echo "Restoring personal settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4683 |  | -  restore_directory_from_friend /root/temppersonal personal
 | 
	
		
			
			|  | 4696 | +  echo '  restore_directory_from_friend /root/temppersonal personal' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4684 | 4697 |    echo '  if [ -d /home/$MY_USERNAME/personal ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4685 | 4698 |    echo '    rm -rf /home/$MY_USERNAME/personal' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4686 | 4699 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4699,7 +4712,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4699 | 4712 |    fi
 | 
	
		
			
			| 4700 | 4713 |    echo "if [ -d $PUBLIC_MAILING_LIST_DIRECTORY ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4701 | 4714 |    echo '  echo "Restoring public mailing list"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4702 |  | -  restore_directory_from_friend /root/tempmailinglist mailinglist
 | 
	
		
			
			|  | 4715 | +  echo '  restore_directory_from_friend /root/tempmailinglist mailinglist' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4703 | 4716 |    echo "  cp -r /root/tempmailinglist/${RESTORE_SUBDIR}/spool/mlmmj/* $PUBLIC_MAILING_LIST_DIRECTORY" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4704 | 4717 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4705 | 4718 |    echo '    exit 526' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4714,7 +4727,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4714 | 4727 |    fi
 | 
	
		
			
			| 4715 | 4728 |    echo "if [ -d $XMPP_DIRECTORY ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4716 | 4729 |    echo '  echo "Restoring XMPP settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4717 |  | -  restore_directory_from_friend /root/tempxmpp xmpp
 | 
	
		
			
			|  | 4730 | +  echo '  restore_directory_from_friend /root/tempxmpp xmpp' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4718 | 4731 |    echo "  cp -r /root/tempxmpp/${RESTORE_SUBDIR}/lib/prosody/* $XMPP_DIRECTORY" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4719 | 4732 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4720 | 4733 |    echo '    exit 725' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4729,7 +4742,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4729 | 4742 |  
 | 
	
		
			
			| 4730 | 4743 |    if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
 | 
	
		
			
			| 4731 | 4744 |        BACKUP_INCLUDES_WEBSITES="yes"
 | 
	
		
			
			| 4732 |  | -      restore_database_from_friend gnusocial $MICROBLOG_DOMAIN_NAME
 | 
	
		
			
			|  | 4745 | +      echo "restore_database_from_friend gnusocial $MICROBLOG_DOMAIN_NAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4733 | 4746 |        echo "if [ -d /root/tempgnusocial ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4734 | 4747 |        echo "  rm -rf /root/tempgnusocial" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4735 | 4748 |        echo "fi" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4737,7 +4750,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4737 | 4750 |  
 | 
	
		
			
			| 4738 | 4751 |    if grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
 | 
	
		
			
			| 4739 | 4752 |        BACKUP_INCLUDES_WEBSITES="yes"
 | 
	
		
			
			| 4740 |  | -      restore_database_from_friend hubzilla $HUBZILLA_DOMAIN_NAME
 | 
	
		
			
			|  | 4753 | +      echo "restore_database_from_friend hubzilla $HUBZILLA_DOMAIN_NAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4741 | 4754 |        echo 'if [ -d $SERVER_DIRECTORY/backup/hubzilla ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4742 | 4755 |        echo "  if [ ! -d /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/store/[data]/smarty3 ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4743 | 4756 |        echo "    mkdir -p /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/store/[data]/smarty3" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4753,7 +4766,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4753 | 4766 |  
 | 
	
		
			
			| 4754 | 4767 |    if grep -Fxq "install_owncloud" $COMPLETION_FILE; then
 | 
	
		
			
			| 4755 | 4768 |        BACKUP_INCLUDES_WEBSITES="yes"
 | 
	
		
			
			| 4756 |  | -      restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME
 | 
	
		
			
			|  | 4769 | +      echo "restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4757 | 4770 |        RESTORE_SUBDIR='var'
 | 
	
		
			
			| 4758 | 4771 |        if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4759 | 4772 |            RESTORE_SUBDIR='remoterestore/backup/owncloud'
 | 
	
	
		
			
			|  | @@ -4764,7 +4777,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4764 | 4777 |        echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4765 | 4778 |        echo '    exit 981' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4766 | 4779 |        echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4767 |  | -      restore_directory_from_friend /root/tempowncloud2 owncloud2
 | 
	
		
			
			|  | 4780 | +      echo 'restore_directory_from_friend /root/tempowncloud2 owncloud2' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4768 | 4781 |        RESTORE_SUBDIR='etc'
 | 
	
		
			
			| 4769 | 4782 |        if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4770 | 4783 |            RESTORE_SUBDIR='remoterestore/backup/owncloud2'
 | 
	
	
		
			
			|  | @@ -4786,7 +4799,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4786 | 4799 |  
 | 
	
		
			
			| 4787 | 4800 |    if grep -Fxq "install_gogs" $COMPLETION_FILE; then
 | 
	
		
			
			| 4788 | 4801 |        BACKUP_INCLUDES_WEBSITES="yes"
 | 
	
		
			
			| 4789 |  | -      restore_database_from_friend gogs $GIT_DOMAIN_NAME
 | 
	
		
			
			|  | 4802 | +      echo "restore_database_from_friend gogs $GIT_DOMAIN_NAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4790 | 4803 |        RESTORE_SUBDIR='home'
 | 
	
		
			
			| 4791 | 4804 |        if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4792 | 4805 |            RESTORE_SUBDIR='remoterestore/backup/gogs'
 | 
	
	
		
			
			|  | @@ -4800,7 +4813,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4800 | 4813 |        echo '    exit 5885' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4801 | 4814 |        echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4802 | 4815 |        echo '  echo "Restoring Gogs repos"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4803 |  | -      restore_directory_from_friend /root/tempgogsrepos gogsrepos
 | 
	
		
			
			|  | 4816 | +      echo '  restore_directory_from_friend /root/tempgogsrepos gogsrepos' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4804 | 4817 |        RESTORE_SUBDIR='home'
 | 
	
		
			
			| 4805 | 4818 |        if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4806 | 4819 |            RESTORE_SUBDIR='remoterestore/backup/gogsrepos'
 | 
	
	
		
			
			|  | @@ -4810,7 +4823,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4810 | 4823 |        echo '    exit 7649' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4811 | 4824 |        echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4812 | 4825 |        echo '  echo "Restoring Gogs authorized_keys"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4813 |  | -      restore_directory_from_friend /root/tempgogsssh gogsssh
 | 
	
		
			
			|  | 4826 | +      echo '  restore_directory_from_friend /root/tempgogsssh gogsssh' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4814 | 4827 |        echo '  if [ ! -d /home/git/.ssh ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4815 | 4828 |        echo '    mkdir /home/git/.ssh' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4816 | 4829 |        echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4836,12 +4849,12 @@ function restore_from_friend {
 | 
	
		
			
			| 4836 | 4849 |    fi
 | 
	
		
			
			| 4837 | 4850 |    echo 'if [ -d $SERVER_DIRECTORY/backup/wiki ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4838 | 4851 |    echo '  echo "Restoring Wiki installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4839 |  | -  restore_directory_from_friend /root/tempwiki wiki
 | 
	
		
			
			|  | 4852 | +  echo '  restore_directory_from_friend /root/tempwiki wiki' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4840 | 4853 |    echo "  cp -r /root/tempwiki/${RESTORE_SUBDIR}/lib/dokuwiki/* /var/lib/dokuwiki/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4841 | 4854 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4842 | 4855 |    echo '    exit 868' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4843 | 4856 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4844 |  | -  restore_directory_from_friend /root/tempwiki2 wiki2
 | 
	
		
			
			|  | 4857 | +  echo '  restore_directory_from_friend /root/tempwiki2 wiki2' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4845 | 4858 |    RESTORE_SUBDIR='etc'
 | 
	
		
			
			| 4846 | 4859 |    if [[ $BACKUP_TYPE != 'obnam' ]]; then
 | 
	
		
			
			| 4847 | 4860 |        RESTORE_SUBDIR='remoterestore/backup/wiki2'
 | 
	
	
		
			
			|  | @@ -4867,7 +4880,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4867 | 4880 |    echo 'if [ -d $SERVER_DIRECTORY/backup/blog ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4868 | 4881 |    echo '  echo "Restoring blog installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4869 | 4882 |    echo '  mkdir /root/tempblog' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4870 |  | -  restore_directory_from_friend /root/tempblog blog
 | 
	
		
			
			|  | 4883 | +  echo '  restore_directory_from_friend /root/tempblog blog' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4871 | 4884 |    echo "  rm -rf /var/www/$FULLBLOG_DOMAIN_NAME/htdocs" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4872 | 4885 |    echo "  cp -r /root/tempblog/${RESTORE_SUBDIR}/www/$FULLBLOG_DOMAIN_NAME/htdocs /var/www/$FULLBLOG_DOMAIN_NAME/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4873 | 4886 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4891,7 +4904,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4891 | 4904 |    fi
 | 
	
		
			
			| 4892 | 4905 |    echo 'if [ -d $SERVER_DIRECTORY/backup/cjdns ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4893 | 4906 |    echo '  echo "Restoring cjdns installation"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4894 |  | -  restore_directory_from_friend /root/tempcjdns cjdns
 | 
	
		
			
			|  | 4907 | +  echo '  restore_directory_from_friend /root/tempcjdns cjdns' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4895 | 4908 |    echo "  rm -rf /etc/cjdns" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4896 | 4909 |    echo "  cp -r /root/tempcjdns/${RESTORE_SUBDIR}/cjdns /etc/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4897 | 4910 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4907,7 +4920,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4907 | 4920 |    fi
 | 
	
		
			
			| 4908 | 4921 |    echo 'if [ -d $SERVER_DIRECTORY/backup/voip ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4909 | 4922 |    echo '  echo "Restoring VoIP settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4910 |  | -  restore_directory_from_friend /root/tempvoip voip
 | 
	
		
			
			|  | 4923 | +  echo '  restore_directory_from_friend /root/tempvoip voip' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4911 | 4924 |    echo -n "  cp -f /root/tempvoip/${RESTORE_SUBDIR}" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4912 | 4925 |    echo -n '/$MY_USERNAME/tempbackup/' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4913 | 4926 |    echo "$VOIP_CONFIG_FILE /etc/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4931,7 +4944,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4931 | 4944 |  
 | 
	
		
			
			| 4932 | 4945 |    echo 'if [ -d $SERVER_DIRECTORY/backup/tox ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4933 | 4946 |    echo '  echo "Restoring Tox node settings"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4934 |  | -  restore_directory_from_friend /var/lib/tox-bootstrapd tox
 | 
	
		
			
			|  | 4947 | +  echo '  restore_directory_from_friend /var/lib/tox-bootstrapd tox' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4935 | 4948 |    echo '  if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4936 | 4949 |    echo '    exit 93653' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4937 | 4950 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4950,7 +4963,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4950 | 4963 |    fi
 | 
	
		
			
			| 4951 | 4964 |    echo 'if [ -d $SERVER_DIRECTORY/backup/mail ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4952 | 4965 |    echo '  echo "Restoring emails"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4953 |  | -  restore_directory_from_friend /root/tempmail mail
 | 
	
		
			
			|  | 4966 | +  echo '  restore_directory_from_friend /root/tempmail mail' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4954 | 4967 |    echo '  if [ ! -d /home/$MY_USERNAME/Maildir ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4955 | 4968 |    echo '    mkdir /home/$MY_USERNAME/Maildir' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4956 | 4969 |    echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
	
		
			
			|  | @@ -4969,7 +4982,7 @@ function restore_from_friend {
 | 
	
		
			
			| 4969 | 4982 |    echo "if [ -d /var/cache/minidlna ]; then" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4970 | 4983 |    echo '  if [ -d $SERVER_DIRECTORY/backup/dlna ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4971 | 4984 |    echo '    echo "Restoring DLNA cache"' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4972 |  | -  restore_directory_from_friend /root/tempdlna dlna
 | 
	
		
			
			|  | 4985 | +  echo '    restore_directory_from_friend /root/tempdlna dlna' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4973 | 4986 |    echo "    cp -r /root/tempdlna/${RESTORE_SUBDIR}/cache/minidlna/* /var/cache/minidlna/" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4974 | 4987 |    echo '    if [ ! "$?" = "0" ]; then' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 | 
	
		
			
			| 4975 | 4988 |    echo '      exit 982' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
 |