This commit is contained in:
Bob Mottram 2016-07-10 11:33:50 +01:00
parent bccd2443b0
commit d540a4b1cb
1 changed files with 22 additions and 18 deletions

View File

@ -320,20 +320,21 @@ function restore_mutt_settings {
${PROJECT_NAME}-adduser $USERNAME
fi
echo $"Restoring Mutt settings for $USERNAME"
restore_directory_from_usb /root/tempmutt mutt/$USERNAME
if [ -f /root/tempmutt/home/$USERNAME/tempbackup/.muttrc ]; then
cp -f /root/tempmutt/home/$USERNAME/tempbackup/.muttrc /home/$USERNAME/.muttrc
temp_restore_dir=/root/tempmutt
restore_directory_from_usb $temp_restore_dir mutt/$USERNAME
if [ -f $temp_restore_dir/home/$USERNAME/tempbackup/.muttrc ]; then
cp -f $temp_restore_dir/home/$USERNAME/tempbackup/.muttrc /home/$USERNAME/.muttrc
fi
if [ -f /root/tempmutt/home/$USERNAME/tempbackup/Muttrc ]; then
cp -f /root/tempmutt/home/$USERNAME/tempbackup/Muttrc /etc/Muttrc
if [ -f $temp_restore_dir/home/$USERNAME/tempbackup/Muttrc ]; then
cp -f $temp_restore_dir/home/$USERNAME/tempbackup/Muttrc /etc/Muttrc
fi
if [ ! "$?" = "0" ]; then
rm -rf /root/tempmutt
rm -rf $temp_restore_dir
set_user_permissions
backup_unmount_drive
exit 276
fi
rm -rf /root/tempmutt
rm -rf $temp_restore_dir
fi
done
fi
@ -353,15 +354,16 @@ function restore_gpg {
${PROJECT_NAME}-adduser $USERNAME
fi
echo $"Restoring gnupg settings for $USERNAME"
restore_directory_from_usb /root/tempgnupg gnupg/$USERNAME
cp -r /root/tempgnupg/home/$USERNAME/.gnupg /home/$USERNAME/
temp_restore_dir=/root/tempgnupg
restore_directory_from_usb $temp_restore_dir gnupg/$USERNAME
cp -r $temp_restore_dir/home/$USERNAME/.gnupg /home/$USERNAME/
if [ ! "$?" = "0" ]; then
rm -rf /root/tempgnupg
rm -rf $temp_restore_dir
set_user_permissions
backup_unmount_drive
exit 276
fi
rm -rf /root/tempgnupg
rm -rf $temp_restore_dir
if [[ "$USERNAME" == "$ADMIN_USERNAME" ]]; then
cp -r /home/$USERNAME/.gnupg /root
if [ ! "$?" = "0" ]; then
@ -389,15 +391,16 @@ function restore_procmail {
${PROJECT_NAME}-adduser $USERNAME
fi
echo $"Restoring procmail settings for $USERNAME"
restore_directory_from_usb /root/tempprocmail procmail/$USERNAME
cp -f /root/tempprocmail/home/$USERNAME/tempbackup/.procmailrc /home/$USERNAME/
temp_restore_dir=/root/tempprocmail
restore_directory_from_usb $temp_restore_dir procmail/$USERNAME
cp -f $temp_restore_dir/home/$USERNAME/tempbackup/.procmailrc /home/$USERNAME/
if [ ! "$?" = "0" ]; then
rm -rf /root/tempprocmail
rm -rf $temp_restore_dir
set_user_permissions
backup_unmount_drive
exit 276
fi
rm -rf /root/tempprocmail
rm -rf $temp_restore_dir
fi
done
fi
@ -716,14 +719,15 @@ function restore_mailing_list {
fi
if [ -d /var/spool/mlmmj ]; then
echo $"Restoring public mailing list"
restore_directory_from_usb /root/tempmailinglist mailinglist
cp -r /root/tempmailinglist/root/spool/mlmmj/* /var/spool/mlmmj
temp_restore_dir=/root/tempmailinglist
restore_directory_from_usb $temp_restore_dir mailinglist
cp -r $temp_restore_dir/root/spool/mlmmj/* /var/spool/mlmmj
if [ ! "$?" = "0" ]; then
set_user_permissions
backup_unmount_drive
exit 526
fi
rm -rf /root/tempmailinglist
rm -rf $temp_restore_dir
fi
}