Admin user formatting

This commit is contained in:
Bob Mottram 2015-12-08 09:54:49 +00:00
parent acfab98045
commit 00f3760705
1 changed files with 19 additions and 5 deletions

View File

@ -2831,7 +2831,9 @@ function create_backup_script {
echo "USB_MOUNT=$USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n 'ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | ' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo "awk -F ':' '{print $2}')" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n "awk -F ':' '{print " >> /usr/bin/$BACKUP_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
"}')" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'MY_USERNAME=$ADMIN_USERNAME' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'if [ $2 ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' MY_USERNAME=$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
@ -3407,7 +3409,9 @@ function create_restore_script {
echo "USB_MOUNT=$USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo -n 'ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | ' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo "awk -F ':' '{print $2}')" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo -n "awk -F ':' '{print " >> /usr/bin/$RESTORE_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo "}')" >> /usr/bin/$RESTORE_SCRIPT_NAME
echo 'MY_USERNAME=$ADMIN_USERNAME' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo 'if [ $2 ]; then' >> /usr/bin/$RESTORE_SCRIPT_NAME
echo ' MY_USERNAME=$2' >> /usr/bin/$RESTORE_SCRIPT_NAME
@ -4599,7 +4603,13 @@ function backup_to_friends_servers {
echo '# Temporary location for data to be backed up to other servers' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo 'SERVER_DIRECTORY=/root/remotebackup' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "MY_USERNAME=$MY_USERNAME" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "COMPLETION_FILE=$COMPLETION_FILE" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n 'ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | ' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n "awk -F ':' '{print " >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo -n '$2' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "}')" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo 'MY_USERNAME=$ADMIN_USERNAME' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo "if [ ! -f $BACKUP_CERTIFICATE ]; then" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
@ -5219,9 +5229,13 @@ function restore_from_friend {
echo '#!/bin/bash' > /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo 'SERVER_NAME=$1' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo "MY_USERNAME=$MY_USERNAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo "COMPLETION_FILE=$COMPLETION_FILE" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo -n 'ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | ' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo -n"awk -F ':' '{print " >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo -n'$2' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo "}')" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo 'MY_USERNAME=$ADMIN_USERNAME' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo '# Temporary location for data to be backed up to other servers' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo 'SERVER_DIRECTORY=/root/remoterestore' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
echo '' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME