|
@@ -666,85 +666,6 @@ function restore_mailing_list {
|
666
|
666
|
fi
|
667
|
667
|
}
|
668
|
668
|
|
669
|
|
-function restore_syncthing {
|
670
|
|
- if [[ $RESTORE_APP != 'all' ]]; then
|
671
|
|
- if [[ $RESTORE_APP != 'syncthing' ]]; then
|
672
|
|
- return
|
673
|
|
- fi
|
674
|
|
- fi
|
675
|
|
-
|
676
|
|
- if [ -f /etc/systemd/system/syncthing.service ]; then
|
677
|
|
- systemctl stop syncthing
|
678
|
|
- systemctl stop cron
|
679
|
|
- fi
|
680
|
|
-
|
681
|
|
- if [ -d $SERVER_DIRECTORY/backup/syncthingconfig ]; then
|
682
|
|
- echo $"Restoring syncthing configuration"
|
683
|
|
- temp_restore_dir=/root/tempsyncthingconfig
|
684
|
|
- restore_directory_from_friend $temp_restore_dir syncthingconfig
|
685
|
|
- cp -r $temp_restore_dir/* /
|
686
|
|
- if [ ! "$?" = "0" ]; then
|
687
|
|
- unmount_drive
|
688
|
|
- systemctl start syncthing
|
689
|
|
- systemctl start cron
|
690
|
|
- exit 6833
|
691
|
|
- fi
|
692
|
|
- rm -rf $temp_restore_dir
|
693
|
|
- fi
|
694
|
|
-
|
695
|
|
- if [ -d $SERVER_DIRECTORY/backup/syncthingshared ]; then
|
696
|
|
- echo $"Restoring syncthing shared files"
|
697
|
|
- temp_restore_dir=/root/tempsyncthingshared
|
698
|
|
- restore_directory_from_friend $temp_restore_dir syncthingshared
|
699
|
|
- cp -r $temp_restore_dir/* /
|
700
|
|
- if [ ! "$?" = "0" ]; then
|
701
|
|
- unmount_drive
|
702
|
|
- systemctl start syncthing
|
703
|
|
- systemctl start cron
|
704
|
|
- exit 37904
|
705
|
|
- fi
|
706
|
|
- rm -rf $temp_restore_dir
|
707
|
|
- fi
|
708
|
|
-
|
709
|
|
- if [ -d $SERVER_DIRECTORY/backup/syncthing ]; then
|
710
|
|
- for d in $SERVER_DIRECTORY/backup/syncthing/*/ ; do
|
711
|
|
- USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
712
|
|
- if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
713
|
|
- if [ ! -d /home/$USERNAME ]; then
|
714
|
|
- ${PROJECT_NAME}-adduser $USERNAME
|
715
|
|
- fi
|
716
|
|
- echo $"Restoring syncthing files for $USERNAME"
|
717
|
|
- temp_restore_dir=/root/tempsyncthing
|
718
|
|
- restore_directory_from_friend $temp_restore_dir syncthing/$USERNAME
|
719
|
|
- cp -r $temp_restore_dir/home/$USERNAME/Sync /home/$USERNAME/
|
720
|
|
- if [ ! "$?" = "0" ]; then
|
721
|
|
- rm -rf $temp_restore_dir
|
722
|
|
- unmount_drive
|
723
|
|
- systemctl start syncthing
|
724
|
|
- systemctl start cron
|
725
|
|
- exit 68438
|
726
|
|
- fi
|
727
|
|
- rm -rf $temp_restore_dir
|
728
|
|
-
|
729
|
|
- # restore device IDs from config settings
|
730
|
|
- if [ -f /home/$USERNAME/.config/syncthing/.syncthing-server-id ]; then
|
731
|
|
- cp /home/$USERNAME/.config/syncthing/.syncthing-server-id /home/$USERNAME/.syncthing-server-id
|
732
|
|
- chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id
|
733
|
|
- fi
|
734
|
|
- if [ -f /home/$USERNAME/.config/syncthing/.syncthingids ]; then
|
735
|
|
- cp /home/$USERNAME/.config/syncthing/.syncthingids /home/$USERNAME/.syncthingids
|
736
|
|
- chown $USERNAME:$USERNAME /home/$USERNAME/.syncthingids
|
737
|
|
- fi
|
738
|
|
- fi
|
739
|
|
- done
|
740
|
|
- fi
|
741
|
|
-
|
742
|
|
- if [ -f /etc/systemd/system/syncthing.service ]; then
|
743
|
|
- systemctl start syncthing
|
744
|
|
- systemctl start cron
|
745
|
|
- fi
|
746
|
|
-}
|
747
|
|
-
|
748
|
669
|
function restore_mediagoblin {
|
749
|
670
|
if [[ $RESTORE_APP != 'all' ]]; then
|
750
|
671
|
if [[ $RESTORE_APP != 'mediagoblin' ]]; then
|
|
@@ -1034,7 +955,6 @@ restore_personal_settings
|
1034
|
955
|
restore_mailing_list
|
1035
|
956
|
restore_email
|
1036
|
957
|
|
1037
|
|
-restore_syncthing
|
1038
|
958
|
restore_mediagoblin
|
1039
|
959
|
restore_gogs
|
1040
|
960
|
restore_wiki
|