| 
				
			 | 
			
			
				@@ -119,245 +119,285 @@ function backup_database_to_friend { 
			 | 
		
	
		
			
			| 
				119
			 | 
			
				119
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				120
			 | 
			
				120
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				121
			 | 
			
				121
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				122
			 | 
			
				
			 | 
			
			
				-# configuration files 
			 | 
		
	
		
			
			| 
				123
			 | 
			
				
			 | 
			
			
				-echo $"Backing up ${PROJECT_NAME} configuration files" 
			 | 
		
	
		
			
			| 
				124
			 | 
			
				
			 | 
			
			
				-if [ ! -d /root/tempbackupconfig ]; then 
			 | 
		
	
		
			
			| 
				125
			 | 
			
				
			 | 
			
			
				-    mkdir -p /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				126
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				127
			 | 
			
				
			 | 
			
			
				-cp -f $CONFIG_FILE /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				128
			 | 
			
				
			 | 
			
			
				-cp -f $COMPLETION_FILE /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				129
			 | 
			
				
			 | 
			
			
				-backup_directory_to_friend /root/tempbackupconfig config 
			 | 
		
	
		
			
			| 
				130
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				131
			 | 
			
				
			 | 
			
			
				-# Backup user files 
			 | 
		
	
		
			
			| 
				132
			 | 
			
				
			 | 
			
			
				-for d in /home/*/ ; do 
			 | 
		
	
		
			
			| 
				133
			 | 
			
				
			 | 
			
			
				-    USERNAME=$(echo "$d" | awk -F '/' '{print $3}') 
			 | 
		
	
		
			
			| 
				134
			 | 
			
				
			 | 
			
			
				-    if [[ $USERNAME != "git" ]]; then 
			 | 
		
	
		
			
			| 
				135
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				136
			 | 
			
				
			 | 
			
			
				-        # personal settings 
			 | 
		
	
		
			
			| 
				137
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/personal ]; then 
			 | 
		
	
		
			
			| 
				138
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up personal settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				139
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/personal personal/$USERNAME 
			 | 
		
	
		
			
			| 
				140
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				122
			 | 
			
			
				+function backup_configuration { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				123
			 | 
			
			
				+    echo $"Backing up ${PROJECT_NAME} configuration files" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				124
			 | 
			
			
				+    if [ ! -d /root/tempbackupconfig ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				125
			 | 
			
			
				+        mkdir -p /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				
			 | 
			
				126
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				127
			 | 
			
			
				+    cp -f $CONFIG_FILE /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				
			 | 
			
				128
			 | 
			
			
				+    cp -f $COMPLETION_FILE /root/tempbackupconfig 
			 | 
		
	
		
			
			| 
				
			 | 
			
				129
			 | 
			
			
				+    backup_directory_to_friend /root/tempbackupconfig config 
			 | 
		
	
		
			
			| 
				
			 | 
			
				130
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				141
			 | 
			
				131
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				142
			 | 
			
				
			 | 
			
			
				-        # gpg keys 
			 | 
		
	
		
			
			| 
				143
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/.gnupg ]; then 
			 | 
		
	
		
			
			| 
				144
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up gpg keys for $USERNAME" 
			 | 
		
	
		
			
			| 
				145
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/.gnupg gnupg/$USERNAME 
			 | 
		
	
		
			
			| 
				146
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				132
			 | 
			
			
				+function backup_users { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				133
			 | 
			
			
				+    for d in /home/*/ ; do 
			 | 
		
	
		
			
			| 
				
			 | 
			
				134
			 | 
			
			
				+        USERNAME=$(echo "$d" | awk -F '/' '{print $3}') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				135
			 | 
			
			
				+        if [[ $USERNAME != "git" ]]; then 
			 | 
		
	
		
			
			| 
				147
			 | 
			
				136
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				148
			 | 
			
				
			 | 
			
			
				-        # ssh keys 
			 | 
		
	
		
			
			| 
				149
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/.ssh ]; then 
			 | 
		
	
		
			
			| 
				150
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up ssh keys for $USERNAME" 
			 | 
		
	
		
			
			| 
				151
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/.ssh ssh/$USERNAME 
			 | 
		
	
		
			
			| 
				152
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				137
			 | 
			
			
				+            # personal settings 
			 | 
		
	
		
			
			| 
				
			 | 
			
				138
			 | 
			
			
				+            if [ -d /home/$USERNAME/personal ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				139
			 | 
			
			
				+                echo $"Backing up personal settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				140
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/personal personal/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				141
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				153
			 | 
			
				142
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				154
			 | 
			
				
			 | 
			
			
				-        # config files 
			 | 
		
	
		
			
			| 
				155
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/.config ]; then 
			 | 
		
	
		
			
			| 
				156
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up config files for $USERNAME" 
			 | 
		
	
		
			
			| 
				157
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/.config config/$USERNAME 
			 | 
		
	
		
			
			| 
				158
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				143
			 | 
			
			
				+            # gpg keys 
			 | 
		
	
		
			
			| 
				
			 | 
			
				144
			 | 
			
			
				+            if [ -d /home/$USERNAME/.gnupg ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				145
			 | 
			
			
				+                echo $"Backing up gpg keys for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				146
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/.gnupg gnupg/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				147
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				159
			 | 
			
				148
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				160
			 | 
			
				
			 | 
			
			
				-        # mutt settings 
			 | 
		
	
		
			
			| 
				161
			 | 
			
				
			 | 
			
			
				-        if [ -f /home/$USERNAME/.muttrc ]; then 
			 | 
		
	
		
			
			| 
				162
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up Mutt settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				163
			 | 
			
				
			 | 
			
			
				-            if [ ! -d /home/$USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				164
			 | 
			
				
			 | 
			
			
				-                mkdir -p /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				149
			 | 
			
			
				+            # ssh keys 
			 | 
		
	
		
			
			| 
				
			 | 
			
				150
			 | 
			
			
				+            if [ -d /home/$USERNAME/.ssh ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				151
			 | 
			
			
				+                echo $"Backing up ssh keys for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				152
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/.ssh ssh/$USERNAME 
			 | 
		
	
		
			
			| 
				165
			 | 
			
				153
			 | 
			
			
				             fi 
			 | 
		
	
		
			
			| 
				166
			 | 
			
				
			 | 
			
			
				-            cp /home/$USERNAME/.muttrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				167
			 | 
			
				
			 | 
			
			
				-            if [ -f /etc/Muttrc ]; then 
			 | 
		
	
		
			
			| 
				168
			 | 
			
				
			 | 
			
			
				-                cp /etc/Muttrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				154
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				155
			 | 
			
			
				+            # config files 
			 | 
		
	
		
			
			| 
				
			 | 
			
				156
			 | 
			
			
				+            if [ -d /home/$USERNAME/.config ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				157
			 | 
			
			
				+                echo $"Backing up config files for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				158
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/.config config/$USERNAME 
			 | 
		
	
		
			
			| 
				169
			 | 
			
				159
			 | 
			
			
				             fi 
			 | 
		
	
		
			
			| 
				170
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/tempbackup mutt/$USERNAME 
			 | 
		
	
		
			
			| 
				171
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				172
			 | 
			
				160
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				173
			 | 
			
				
			 | 
			
			
				-        # procmail settings 
			 | 
		
	
		
			
			| 
				174
			 | 
			
				
			 | 
			
			
				-        if [ -f /home/$USERNAME/.procmailrc ]; then 
			 | 
		
	
		
			
			| 
				175
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up procmail settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				176
			 | 
			
				
			 | 
			
			
				-            if [ ! -d /home/$USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				177
			 | 
			
				
			 | 
			
			
				-                mkdir -p /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				161
			 | 
			
			
				+            # mutt settings 
			 | 
		
	
		
			
			| 
				
			 | 
			
				162
			 | 
			
			
				+            if [ -f /home/$USERNAME/.muttrc ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				163
			 | 
			
			
				+                echo $"Backing up Mutt settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				164
			 | 
			
			
				+                if [ ! -d /home/$USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				165
			 | 
			
			
				+                    mkdir -p /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				166
			 | 
			
			
				+                fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				167
			 | 
			
			
				+                cp /home/$USERNAME/.muttrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				168
			 | 
			
			
				+                if [ -f /etc/Muttrc ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				169
			 | 
			
			
				+                    cp /etc/Muttrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				170
			 | 
			
			
				+                fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				171
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/tempbackup mutt/$USERNAME 
			 | 
		
	
		
			
			| 
				178
			 | 
			
				172
			 | 
			
			
				             fi 
			 | 
		
	
		
			
			| 
				179
			 | 
			
				
			 | 
			
			
				-            cp /home/$USERNAME/.procmailrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				180
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/tempbackup procmail/$USERNAME 
			 | 
		
	
		
			
			| 
				181
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				182
			 | 
			
				173
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				183
			 | 
			
				
			 | 
			
			
				-        # spamassassin settings 
			 | 
		
	
		
			
			| 
				184
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/.spamassassin ]; then 
			 | 
		
	
		
			
			| 
				185
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up spamassassin settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				186
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /home/$USERNAME/.spamassassin spamassassin/$USERNAME 
			 | 
		
	
		
			
			| 
				187
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				174
			 | 
			
			
				+            # procmail settings 
			 | 
		
	
		
			
			| 
				
			 | 
			
				175
			 | 
			
			
				+            if [ -f /home/$USERNAME/.procmailrc ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				176
			 | 
			
			
				+                echo $"Backing up procmail settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				177
			 | 
			
			
				+                if [ ! -d /home/$USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				178
			 | 
			
			
				+                    mkdir -p /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				179
			 | 
			
			
				+                fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				180
			 | 
			
			
				+                cp /home/$USERNAME/.procmailrc /home/$USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				181
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/tempbackup procmail/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				182
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				188
			 | 
			
				183
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				189
			 | 
			
				
			 | 
			
			
				-        # email 
			 | 
		
	
		
			
			| 
				190
			 | 
			
				
			 | 
			
			
				-        if [ -d /home/$USERNAME/Maildir ]; then 
			 | 
		
	
		
			
			| 
				191
			 | 
			
				
			 | 
			
			
				-            echo $"Creating an email archive" 
			 | 
		
	
		
			
			| 
				192
			 | 
			
				
			 | 
			
			
				-            if [ ! -d /root/backupemail/$USERNAME ]; then 
			 | 
		
	
		
			
			| 
				193
			 | 
			
				
			 | 
			
			
				-                mkdir -p /root/backupemail/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				184
			 | 
			
			
				+            # spamassassin settings 
			 | 
		
	
		
			
			| 
				
			 | 
			
				185
			 | 
			
			
				+            if [ -d /home/$USERNAME/.spamassassin ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				186
			 | 
			
			
				+                echo $"Backing up spamassassin settings for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				187
			 | 
			
			
				+                backup_directory_to_friend /home/$USERNAME/.spamassassin spamassassin/$USERNAME 
			 | 
		
	
		
			
			| 
				194
			 | 
			
				188
			 | 
			
			
				             fi 
			 | 
		
	
		
			
			| 
				195
			 | 
			
				
			 | 
			
			
				-            tar -czvf /root/backupemail/$USERNAME/maildir.tar.gz /home/$USERNAME/Maildir 
			 | 
		
	
		
			
			| 
				196
			 | 
			
				
			 | 
			
			
				-            echo $"Backing up emails for $USERNAME" 
			 | 
		
	
		
			
			| 
				197
			 | 
			
				
			 | 
			
			
				-            backup_directory_to_friend /root/backupemail/$USERNAME mail/$USERNAME 
			 | 
		
	
		
			
			| 
				198
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				199
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				200
			 | 
			
				
			 | 
			
			
				-done 
			 | 
		
	
		
			
			| 
				201
			 | 
			
				189
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				202
			 | 
			
				
			 | 
			
			
				-# Backup Let's Encrypt 
			 | 
		
	
		
			
			| 
				203
			 | 
			
				
			 | 
			
			
				-if [ -d /etc/letsencrypt ]; then 
			 | 
		
	
		
			
			| 
				204
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up Lets Encrypt settings" 
			 | 
		
	
		
			
			| 
				205
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /etc/letsencrypt letsencrypt 
			 | 
		
	
		
			
			| 
				206
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				190
			 | 
			
			
				+            # email 
			 | 
		
	
		
			
			| 
				
			 | 
			
				191
			 | 
			
			
				+            if [ -d /home/$USERNAME/Maildir ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				192
			 | 
			
			
				+                echo $"Creating an email archive" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				193
			 | 
			
			
				+                if [ ! -d /root/backupemail/$USERNAME ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				194
			 | 
			
			
				+                    mkdir -p /root/backupemail/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				195
			 | 
			
			
				+                fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				196
			 | 
			
			
				+                tar -czvf /root/backupemail/$USERNAME/maildir.tar.gz /home/$USERNAME/Maildir 
			 | 
		
	
		
			
			| 
				
			 | 
			
				197
			 | 
			
			
				+                echo $"Backing up emails for $USERNAME" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				198
			 | 
			
			
				+                backup_directory_to_friend /root/backupemail/$USERNAME mail/$USERNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				199
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				200
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				201
			 | 
			
			
				+    done 
			 | 
		
	
		
			
			| 
				
			 | 
			
				202
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				207
			 | 
			
				203
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				208
			 | 
			
				
			 | 
			
			
				-# Backup gnusocial 
			 | 
		
	
		
			
			| 
				209
			 | 
			
				
			 | 
			
			
				-if grep -q "GNU Social domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				210
			 | 
			
				
			 | 
			
			
				-    MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				211
			 | 
			
				
			 | 
			
			
				-    if [ -d /var/www/${MICROBLOG_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				212
			 | 
			
				
			 | 
			
			
				-        backup_database_to_friend gnusocial 
			 | 
		
	
		
			
			| 
				213
			 | 
			
				
			 | 
			
			
				-        backup_directory_to_friend /root/tempgnusocialdata gnusocialdata 
			 | 
		
	
		
			
			| 
				214
			 | 
			
				
			 | 
			
			
				-        echo $"Backing up GNU social installation" 
			 | 
		
	
		
			
			| 
				215
			 | 
			
				
			 | 
			
			
				-        backup_directory_to_friend /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs gnusocial 
			 | 
		
	
		
			
			| 
				216
			 | 
			
				
			 | 
			
			
				-    else 
			 | 
		
	
		
			
			| 
				217
			 | 
			
				
			 | 
			
			
				-        echo $"GNU Social domain specified but not found in /var/www/${MICROBLOG_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				218
			 | 
			
				
			 | 
			
			
				-        exit 6327 
			 | 
		
	
		
			
			| 
				
			 | 
			
				204
			 | 
			
			
				+function backup_letsencrypt { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				205
			 | 
			
			
				+    if [ -d /etc/letsencrypt ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				206
			 | 
			
			
				+        echo $"Backing up Lets Encrypt settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				207
			 | 
			
			
				+        backup_directory_to_friend /etc/letsencrypt letsencrypt 
			 | 
		
	
		
			
			| 
				219
			 | 
			
				208
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				220
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				209
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				221
			 | 
			
				210
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				222
			 | 
			
				
			 | 
			
			
				-# backup hubzilla 
			 | 
		
	
		
			
			| 
				223
			 | 
			
				
			 | 
			
			
				-if grep -q "Hubzilla domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				224
			 | 
			
				
			 | 
			
			
				-    HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				225
			 | 
			
				
			 | 
			
			
				-    if [ -d /var/www/${HUBZILLA_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				226
			 | 
			
				
			 | 
			
			
				-        backup_database_to_friend hubzilla 
			 | 
		
	
		
			
			| 
				227
			 | 
			
				
			 | 
			
			
				-        backup_directory_to_friend /root/temphubzilladata hubzilladata 
			 | 
		
	
		
			
			| 
				228
			 | 
			
				
			 | 
			
			
				-        echo "Backing up Hubzilla installation" 
			 | 
		
	
		
			
			| 
				229
			 | 
			
				
			 | 
			
			
				-        backup_directory_to_friend /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs hubzilla 
			 | 
		
	
		
			
			| 
				230
			 | 
			
				
			 | 
			
			
				-    else 
			 | 
		
	
		
			
			| 
				231
			 | 
			
				
			 | 
			
			
				-        echo $"Hubzilla domain specified but not found in /var/www/${HUBZILLA_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				232
			 | 
			
				
			 | 
			
			
				-        exit 2578 
			 | 
		
	
		
			
			| 
				
			 | 
			
				211
			 | 
			
			
				+function backup_gnusocial { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				212
			 | 
			
			
				+    if grep -q "GNU Social domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				213
			 | 
			
			
				+        MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				214
			 | 
			
			
				+        if [ -d /var/www/${MICROBLOG_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				215
			 | 
			
			
				+            backup_database_to_friend gnusocial 
			 | 
		
	
		
			
			| 
				
			 | 
			
				216
			 | 
			
			
				+            backup_directory_to_friend /root/tempgnusocialdata gnusocialdata 
			 | 
		
	
		
			
			| 
				
			 | 
			
				217
			 | 
			
			
				+            echo $"Backing up GNU social installation" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				218
			 | 
			
			
				+            backup_directory_to_friend /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs gnusocial 
			 | 
		
	
		
			
			| 
				
			 | 
			
				219
			 | 
			
			
				+        else 
			 | 
		
	
		
			
			| 
				
			 | 
			
				220
			 | 
			
			
				+            echo $"GNU Social domain specified but not found in /var/www/${MICROBLOG_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				221
			 | 
			
			
				+            exit 6327 
			 | 
		
	
		
			
			| 
				
			 | 
			
				222
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				233
			 | 
			
				223
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				234
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				224
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				235
			 | 
			
				225
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				236
			 | 
			
				
			 | 
			
			
				-# backup owncloud 
			 | 
		
	
		
			
			| 
				237
			 | 
			
				
			 | 
			
			
				-if [ -d /etc/owncloud ]; then 
			 | 
		
	
		
			
			| 
				238
			 | 
			
				
			 | 
			
			
				-    backup_database_to_friend owncloud 
			 | 
		
	
		
			
			| 
				239
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /root/tempownclouddata ownclouddata 
			 | 
		
	
		
			
			| 
				240
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up Owncloud data" 
			 | 
		
	
		
			
			| 
				241
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/lib/owncloud owncloud 
			 | 
		
	
		
			
			| 
				242
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /etc/owncloud owncloud2 
			 | 
		
	
		
			
			| 
				243
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				226
			 | 
			
			
				+function backup_hubzilla { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				227
			 | 
			
			
				+    if grep -q "Hubzilla domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				228
			 | 
			
			
				+        HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				229
			 | 
			
			
				+        if [ -d /var/www/${HUBZILLA_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				230
			 | 
			
			
				+            backup_database_to_friend hubzilla 
			 | 
		
	
		
			
			| 
				
			 | 
			
				231
			 | 
			
			
				+            backup_directory_to_friend /root/temphubzilladata hubzilladata 
			 | 
		
	
		
			
			| 
				
			 | 
			
				232
			 | 
			
			
				+            echo "Backing up Hubzilla installation" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				233
			 | 
			
			
				+            backup_directory_to_friend /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs hubzilla 
			 | 
		
	
		
			
			| 
				
			 | 
			
				234
			 | 
			
			
				+        else 
			 | 
		
	
		
			
			| 
				
			 | 
			
				235
			 | 
			
			
				+            echo $"Hubzilla domain specified but not found in /var/www/${HUBZILLA_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				236
			 | 
			
			
				+            exit 2578 
			 | 
		
	
		
			
			| 
				
			 | 
			
				237
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				238
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				239
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				244
			 | 
			
				240
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				245
			 | 
			
				
			 | 
			
			
				-# backup gogs 
			 | 
		
	
		
			
			| 
				246
			 | 
			
				
			 | 
			
			
				-if [ -d /home/git/go/src/github.com/gogits ]; then 
			 | 
		
	
		
			
			| 
				247
			 | 
			
				
			 | 
			
			
				-    backup_database_to_friend gogs 
			 | 
		
	
		
			
			| 
				248
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /root/tempgogsdata gogsdata 
			 | 
		
	
		
			
			| 
				249
			 | 
			
				
			 | 
			
			
				-    echo $"Obtaining Gogs settings backup" 
			 | 
		
	
		
			
			| 
				250
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /home/git/go/src/github.com/gogits/gogs/custom gogs 
			 | 
		
	
		
			
			| 
				251
			 | 
			
				
			 | 
			
			
				-    echo $"Obtaining Gogs repos backup" 
			 | 
		
	
		
			
			| 
				252
			 | 
			
				
			 | 
			
			
				-    mv /home/git/gogs-repositories/*.git /home/git/gogs-repositories/bob 
			 | 
		
	
		
			
			| 
				253
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /home/git/gogs-repositories gogsrepos 
			 | 
		
	
		
			
			| 
				254
			 | 
			
				
			 | 
			
			
				-    echo $"Obtaining Gogs authorized_keys backup" 
			 | 
		
	
		
			
			| 
				255
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /home/git/.ssh gogsssh 
			 | 
		
	
		
			
			| 
				256
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				241
			 | 
			
			
				+function backup_owncloud { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				242
			 | 
			
			
				+    if [ -d /etc/owncloud ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				243
			 | 
			
			
				+        backup_database_to_friend owncloud 
			 | 
		
	
		
			
			| 
				
			 | 
			
				244
			 | 
			
			
				+        backup_directory_to_friend /root/tempownclouddata ownclouddata 
			 | 
		
	
		
			
			| 
				
			 | 
			
				245
			 | 
			
			
				+        echo $"Backing up Owncloud data" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				246
			 | 
			
			
				+        backup_directory_to_friend /var/lib/owncloud owncloud 
			 | 
		
	
		
			
			| 
				
			 | 
			
				247
			 | 
			
			
				+        backup_directory_to_friend /etc/owncloud owncloud2 
			 | 
		
	
		
			
			| 
				
			 | 
			
				248
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				249
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				257
			 | 
			
				250
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				258
			 | 
			
				
			 | 
			
			
				-if [ -d /etc/dokuwiki ]; then 
			 | 
		
	
		
			
			| 
				259
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up wiki" 
			 | 
		
	
		
			
			| 
				260
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/lib/dokuwiki wiki 
			 | 
		
	
		
			
			| 
				261
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /etc/dokuwiki wiki2 
			 | 
		
	
		
			
			| 
				262
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				251
			 | 
			
			
				+function backup_gogs { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				252
			 | 
			
			
				+    if [ -d /home/git/go/src/github.com/gogits ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				253
			 | 
			
			
				+        backup_database_to_friend gogs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				254
			 | 
			
			
				+        backup_directory_to_friend /root/tempgogsdata gogsdata 
			 | 
		
	
		
			
			| 
				
			 | 
			
				255
			 | 
			
			
				+        echo $"Obtaining Gogs settings backup" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				256
			 | 
			
			
				+        backup_directory_to_friend /home/git/go/src/github.com/gogits/gogs/custom gogs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				257
			 | 
			
			
				+        echo $"Obtaining Gogs repos backup" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				258
			 | 
			
			
				+        mv /home/git/gogs-repositories/*.git /home/git/gogs-repositories/bob 
			 | 
		
	
		
			
			| 
				
			 | 
			
				259
			 | 
			
			
				+        backup_directory_to_friend /home/git/gogs-repositories gogsrepos 
			 | 
		
	
		
			
			| 
				
			 | 
			
				260
			 | 
			
			
				+        echo $"Obtaining Gogs authorized_keys backup" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				261
			 | 
			
			
				+        backup_directory_to_friend /home/git/.ssh gogsssh 
			 | 
		
	
		
			
			| 
				
			 | 
			
				262
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				263
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				263
			 | 
			
				264
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				264
			 | 
			
				
			 | 
			
			
				-# Backup blog 
			 | 
		
	
		
			
			| 
				265
			 | 
			
				
			 | 
			
			
				-if grep -q "Blog domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				266
			 | 
			
				
			 | 
			
			
				-    FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				267
			 | 
			
				
			 | 
			
			
				-    if [ -d /var/www/${FULLBLOG_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				268
			 | 
			
				
			 | 
			
			
				-        echo $"Backing up blog" 
			 | 
		
	
		
			
			| 
				269
			 | 
			
				
			 | 
			
			
				-        backup_directory_to_friend /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs blog 
			 | 
		
	
		
			
			| 
				270
			 | 
			
				
			 | 
			
			
				-    else 
			 | 
		
	
		
			
			| 
				271
			 | 
			
				
			 | 
			
			
				-        echo $"Blog domain specified but not found in /var/www/${FULLBLOG_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				272
			 | 
			
				
			 | 
			
			
				-        exit 2578 
			 | 
		
	
		
			
			| 
				
			 | 
			
				265
			 | 
			
			
				+function backup_wiki { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				266
			 | 
			
			
				+    if [ -d /etc/dokuwiki ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				267
			 | 
			
			
				+        echo $"Backing up wiki" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				268
			 | 
			
			
				+        backup_directory_to_friend /var/lib/dokuwiki wiki 
			 | 
		
	
		
			
			| 
				
			 | 
			
				269
			 | 
			
			
				+        backup_directory_to_friend /etc/dokuwiki wiki2 
			 | 
		
	
		
			
			| 
				273
			 | 
			
				270
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				274
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				271
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				275
			 | 
			
				272
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				276
			 | 
			
				
			 | 
			
			
				-# Backup certificates 
			 | 
		
	
		
			
			| 
				277
			 | 
			
				
			 | 
			
			
				-if [ -d /etc/ssl ]; then 
			 | 
		
	
		
			
			| 
				278
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up certificates" 
			 | 
		
	
		
			
			| 
				279
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /etc/ssl ssl 
			 | 
		
	
		
			
			| 
				280
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				273
			 | 
			
			
				+function backup_blog { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				274
			 | 
			
			
				+    if grep -q "Blog domain" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				275
			 | 
			
			
				+        FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				276
			 | 
			
			
				+        if [ -d /var/www/${FULLBLOG_DOMAIN_NAME} ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				277
			 | 
			
			
				+            echo $"Backing up blog" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				278
			 | 
			
			
				+            backup_directory_to_friend /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs blog 
			 | 
		
	
		
			
			| 
				
			 | 
			
				279
			 | 
			
			
				+        else 
			 | 
		
	
		
			
			| 
				
			 | 
			
				280
			 | 
			
			
				+            echo $"Blog domain specified but not found in /var/www/${FULLBLOG_DOMAIN_NAME}" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				281
			 | 
			
			
				+            exit 2578 
			 | 
		
	
		
			
			| 
				
			 | 
			
				282
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				283
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				284
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				281
			 | 
			
				285
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				282
			 | 
			
				
			 | 
			
			
				-# Backup the public mailing list 
			 | 
		
	
		
			
			| 
				283
			 | 
			
				
			 | 
			
			
				-if [ -d /var/spool/mlmmj ]; then 
			 | 
		
	
		
			
			| 
				284
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up the public mailing list" 
			 | 
		
	
		
			
			| 
				285
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/spool/mlmmj mailinglist 
			 | 
		
	
		
			
			| 
				286
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				286
			 | 
			
			
				+function backup_certs { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				287
			 | 
			
			
				+    if [ -d /etc/ssl ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				288
			 | 
			
			
				+        echo $"Backing up certificates" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				289
			 | 
			
			
				+        backup_directory_to_friend /etc/ssl ssl 
			 | 
		
	
		
			
			| 
				
			 | 
			
				290
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				291
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				287
			 | 
			
				292
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				288
			 | 
			
				
			 | 
			
			
				-# Backup xmpp settings 
			 | 
		
	
		
			
			| 
				289
			 | 
			
				
			 | 
			
			
				-if [ -d /var/lib/prosody ]; then 
			 | 
		
	
		
			
			| 
				290
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up the XMPP settings" 
			 | 
		
	
		
			
			| 
				291
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/lib/prosody xmpp 
			 | 
		
	
		
			
			| 
				292
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				293
			 | 
			
			
				+function backup_mailing_list { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				294
			 | 
			
			
				+    if [ -d /var/spool/mlmmj ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				295
			 | 
			
			
				+        echo $"Backing up the public mailing list" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				296
			 | 
			
			
				+        backup_directory_to_friend /var/spool/mlmmj mailinglist 
			 | 
		
	
		
			
			| 
				
			 | 
			
				297
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				298
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				293
			 | 
			
				299
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				294
			 | 
			
				
			 | 
			
			
				-# Backup web sites 
			 | 
		
	
		
			
			| 
				295
			 | 
			
				
			 | 
			
			
				-if [ -d /etc/nginx ]; then 
			 | 
		
	
		
			
			| 
				296
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up web settings" 
			 | 
		
	
		
			
			| 
				297
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /etc/nginx/sites-available web 
			 | 
		
	
		
			
			| 
				298
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				300
			 | 
			
			
				+function backup_xmpp { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				301
			 | 
			
			
				+    if [ -d /var/lib/prosody ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				302
			 | 
			
			
				+        echo $"Backing up the XMPP settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				303
			 | 
			
			
				+        backup_directory_to_friend /var/lib/prosody xmpp 
			 | 
		
	
		
			
			| 
				
			 | 
			
				304
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				305
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				299
			 | 
			
				306
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				300
			 | 
			
				
			 | 
			
			
				-# Backup admin user README file 
			 | 
		
	
		
			
			| 
				301
			 | 
			
				
			 | 
			
			
				-if [ -f /home/$ADMIN_USERNAME/README ]; then 
			 | 
		
	
		
			
			| 
				302
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up README" 
			 | 
		
	
		
			
			| 
				303
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /home/$ADMIN_USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				304
			 | 
			
				
			 | 
			
			
				-        mkdir -p /home/$ADMIN_USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				307
			 | 
			
			
				+function backup_web_server { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				308
			 | 
			
			
				+    if [ -d /etc/nginx ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				309
			 | 
			
			
				+        echo $"Backing up web settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				310
			 | 
			
			
				+        backup_directory_to_friend /etc/nginx/sites-available web 
			 | 
		
	
		
			
			| 
				305
			 | 
			
				311
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				306
			 | 
			
				
			 | 
			
			
				-    cp -f /home/$ADMIN_USERNAME/README /home/$ADMIN_USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				307
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /home/$ADMIN_USERNAME/tempbackup readme 
			 | 
		
	
		
			
			| 
				308
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				312
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				309
			 | 
			
				313
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				310
			 | 
			
				
			 | 
			
			
				-# Backup IPFS 
			 | 
		
	
		
			
			| 
				311
			 | 
			
				
			 | 
			
			
				-if [ -d /home/$ADMIN_USERNAME/.ipfs ]; then 
			 | 
		
	
		
			
			| 
				312
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up IPFS" 
			 | 
		
	
		
			
			| 
				313
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /home/$ADMIN_USERNAME/.ipfs ipfs 
			 | 
		
	
		
			
			| 
				314
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				314
			 | 
			
			
				+function backup_admin_readme { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				315
			 | 
			
			
				+    if [ -f /home/$ADMIN_USERNAME/README ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				316
			 | 
			
			
				+        echo $"Backing up README" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				317
			 | 
			
			
				+        if [ ! -d /home/$ADMIN_USERNAME/tempbackup ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				318
			 | 
			
			
				+            mkdir -p /home/$ADMIN_USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				319
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				320
			 | 
			
			
				+        cp -f /home/$ADMIN_USERNAME/README /home/$ADMIN_USERNAME/tempbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				321
			 | 
			
			
				+        backup_directory_to_friend /home/$ADMIN_USERNAME/tempbackup readme 
			 | 
		
	
		
			
			| 
				
			 | 
			
				322
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				323
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				315
			 | 
			
				324
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				316
			 | 
			
				
			 | 
			
			
				-# Backup DLNA cache 
			 | 
		
	
		
			
			| 
				317
			 | 
			
				
			 | 
			
			
				-if [ -d /var/cache/minidlna ]; then 
			 | 
		
	
		
			
			| 
				318
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up DLNA cache" 
			 | 
		
	
		
			
			| 
				319
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/cache/minidlna dlna 
			 | 
		
	
		
			
			| 
				320
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				325
			 | 
			
			
				+function backup_ipfs { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				326
			 | 
			
			
				+    if [ -d /home/$ADMIN_USERNAME/.ipfs ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				327
			 | 
			
			
				+        echo $"Backing up IPFS" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				328
			 | 
			
			
				+        backup_directory_to_friend /home/$ADMIN_USERNAME/.ipfs ipfs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				329
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				330
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				321
			 | 
			
				331
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				322
			 | 
			
				
			 | 
			
			
				-# Backup VoIP settings 
			 | 
		
	
		
			
			| 
				323
			 | 
			
				
			 | 
			
			
				-if [ -f /etc/mumble-server.ini ]; then 
			 | 
		
	
		
			
			| 
				324
			 | 
			
				
			 | 
			
			
				-    echo $"Backing up VoIP settings" 
			 | 
		
	
		
			
			| 
				325
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /root/tempvoipbackup ]; then 
			 | 
		
	
		
			
			| 
				326
			 | 
			
				
			 | 
			
			
				-        mkdir -p /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				332
			 | 
			
			
				+function backup_dlna { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				333
			 | 
			
			
				+    if [ -d /var/cache/minidlna ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				334
			 | 
			
			
				+        echo $"Backing up DLNA cache" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				335
			 | 
			
			
				+        backup_directory_to_friend /var/cache/minidlna dlna 
			 | 
		
	
		
			
			| 
				327
			 | 
			
				336
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				328
			 | 
			
				
			 | 
			
			
				-    cp -f /etc/mumble-server.ini /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				329
			 | 
			
				
			 | 
			
			
				-    cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				330
			 | 
			
				
			 | 
			
			
				-    cp -f /etc/sipwitch.conf /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				331
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /root/tempvoipbackup voip 
			 | 
		
	
		
			
			| 
				332
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				337
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				333
			 | 
			
				338
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				334
			 | 
			
				
			 | 
			
			
				-# Backup Tox node settings 
			 | 
		
	
		
			
			| 
				335
			 | 
			
				
			 | 
			
			
				-if [ -d /var/lib/tox-bootstrapd ]; then 
			 | 
		
	
		
			
			| 
				336
			 | 
			
				
			 | 
			
			
				-    echo "Backing up Tox node settings" 
			 | 
		
	
		
			
			| 
				337
			 | 
			
				
			 | 
			
			
				-    if [ -d /var/lib/tox-bootstrapd/Maildir ]; then 
			 | 
		
	
		
			
			| 
				338
			 | 
			
				
			 | 
			
			
				-        rm -rf /var/lib/tox-bootstrapd/Maildir 
			 | 
		
	
		
			
			| 
				
			 | 
			
				339
			 | 
			
			
				+function backup_voip { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				340
			 | 
			
			
				+    if [ -f /etc/mumble-server.ini ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				341
			 | 
			
			
				+        echo $"Backing up VoIP settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				342
			 | 
			
			
				+        if [ ! -d /root/tempvoipbackup ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				343
			 | 
			
			
				+            mkdir -p /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				344
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				345
			 | 
			
			
				+        cp -f /etc/mumble-server.ini /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				346
			 | 
			
			
				+        cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				347
			 | 
			
			
				+        cp -f /etc/sipwitch.conf /root/tempvoipbackup 
			 | 
		
	
		
			
			| 
				
			 | 
			
				348
			 | 
			
			
				+        backup_directory_to_friend /root/tempvoipbackup voip 
			 | 
		
	
		
			
			| 
				339
			 | 
			
				349
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				340
			 | 
			
				
			 | 
			
			
				-    cp /etc/tox-bootstrapd.conf /var/lib/tox-bootstrapd 
			 | 
		
	
		
			
			| 
				341
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /var/lib/tox-bootstrapd tox 
			 | 
		
	
		
			
			| 
				342
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				350
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				343
			 | 
			
				351
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				344
			 | 
			
				
			 | 
			
			
				-# MariaDB settings 
			 | 
		
	
		
			
			| 
				345
			 | 
			
				
			 | 
			
			
				-if [ ${#DATABASE_PASSWORD} -gt 1 ]; then 
			 | 
		
	
		
			
			| 
				346
			 | 
			
				
			 | 
			
			
				-    if [ ! -d /root/tempmariadb ]; then 
			 | 
		
	
		
			
			| 
				347
			 | 
			
				
			 | 
			
			
				-        mkdir /root/tempmariadb 
			 | 
		
	
		
			
			| 
				
			 | 
			
				352
			 | 
			
			
				+function backup_tox { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				353
			 | 
			
			
				+    if [ -d /var/lib/tox-bootstrapd ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				354
			 | 
			
			
				+        echo "Backing up Tox node settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				355
			 | 
			
			
				+        if [ -d /var/lib/tox-bootstrapd/Maildir ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				356
			 | 
			
			
				+            rm -rf /var/lib/tox-bootstrapd/Maildir 
			 | 
		
	
		
			
			| 
				
			 | 
			
				357
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				358
			 | 
			
			
				+        cp /etc/tox-bootstrapd.conf /var/lib/tox-bootstrapd 
			 | 
		
	
		
			
			| 
				
			 | 
			
				359
			 | 
			
			
				+        backup_directory_to_friend /var/lib/tox-bootstrapd tox 
			 | 
		
	
		
			
			| 
				348
			 | 
			
				360
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				349
			 | 
			
				
			 | 
			
			
				-    mysqldump --password=$DATABASE_PASSWORD mysql user > /root/tempmariadb/mysql.sql 
			 | 
		
	
		
			
			| 
				350
			 | 
			
				
			 | 
			
			
				-    if [ ! -s /root/tempmariadb/mysql.sql ]; then 
			 | 
		
	
		
			
			| 
				351
			 | 
			
				
			 | 
			
			
				-        echo $"Unable to backup MariaDB settings" 
			 | 
		
	
		
			
			| 
				352
			 | 
			
				
			 | 
			
			
				-        rm -rf /root/tempmariadb 
			 | 
		
	
		
			
			| 
				353
			 | 
			
				
			 | 
			
			
				-        # Send a warning email 
			 | 
		
	
		
			
			| 
				354
			 | 
			
				
			 | 
			
			
				-        echo $"Unable to export database settings" | mail -s "${PROJECT_NAME} backup to friends" $ADMIN_EMAIL_ADDRESS 
			 | 
		
	
		
			
			| 
				355
			 | 
			
				
			 | 
			
			
				-        exit 653 
			 | 
		
	
		
			
			| 
				
			 | 
			
				361
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				362
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				363
			 | 
			
			
				+function backup_mariadb { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				364
			 | 
			
			
				+    if [ ${#DATABASE_PASSWORD} -gt 1 ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				365
			 | 
			
			
				+        if [ ! -d /root/tempmariadb ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				366
			 | 
			
			
				+            mkdir /root/tempmariadb 
			 | 
		
	
		
			
			| 
				
			 | 
			
				367
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				368
			 | 
			
			
				+        mysqldump --password=$DATABASE_PASSWORD mysql user > /root/tempmariadb/mysql.sql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				369
			 | 
			
			
				+        if [ ! -s /root/tempmariadb/mysql.sql ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				370
			 | 
			
			
				+            echo $"Unable to backup MariaDB settings" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				371
			 | 
			
			
				+            rm -rf /root/tempmariadb 
			 | 
		
	
		
			
			| 
				
			 | 
			
				372
			 | 
			
			
				+            # Send a warning email 
			 | 
		
	
		
			
			| 
				
			 | 
			
				373
			 | 
			
			
				+            echo $"Unable to export database settings" | mail -s "${PROJECT_NAME} backup to friends" $ADMIN_EMAIL_ADDRESS 
			 | 
		
	
		
			
			| 
				
			 | 
			
				374
			 | 
			
			
				+            exit 653 
			 | 
		
	
		
			
			| 
				
			 | 
			
				375
			 | 
			
			
				+        fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				376
			 | 
			
			
				+        echo "$DATABASE_PASSWORD" > /root/tempmariadb/db 
			 | 
		
	
		
			
			| 
				
			 | 
			
				377
			 | 
			
			
				+        chmod 400 /root/tempmariadb/db 
			 | 
		
	
		
			
			| 
				
			 | 
			
				378
			 | 
			
			
				+        backup_directory_to_friend /root/tempmariadb mariadb 
			 | 
		
	
		
			
			| 
				356
			 | 
			
				379
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				357
			 | 
			
				
			 | 
			
			
				-    echo "$DATABASE_PASSWORD" > /root/tempmariadb/db 
			 | 
		
	
		
			
			| 
				358
			 | 
			
				
			 | 
			
			
				-    chmod 400 /root/tempmariadb/db 
			 | 
		
	
		
			
			| 
				359
			 | 
			
				
			 | 
			
			
				-    backup_directory_to_friend /root/tempmariadb mariadb 
			 | 
		
	
		
			
			| 
				360
			 | 
			
				
			 | 
			
			
				-fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				380
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				381
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				382
			 | 
			
			
				+backup_configuration 
			 | 
		
	
		
			
			| 
				
			 | 
			
				383
			 | 
			
			
				+backup_users 
			 | 
		
	
		
			
			| 
				
			 | 
			
				384
			 | 
			
			
				+backup_letsencrypt 
			 | 
		
	
		
			
			| 
				
			 | 
			
				385
			 | 
			
			
				+backup_gnusocial 
			 | 
		
	
		
			
			| 
				
			 | 
			
				386
			 | 
			
			
				+backup_hubzilla 
			 | 
		
	
		
			
			| 
				
			 | 
			
				387
			 | 
			
			
				+backup_owncloud 
			 | 
		
	
		
			
			| 
				
			 | 
			
				388
			 | 
			
			
				+backup_gogs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				389
			 | 
			
			
				+backup_wiki 
			 | 
		
	
		
			
			| 
				
			 | 
			
				390
			 | 
			
			
				+backup_blog 
			 | 
		
	
		
			
			| 
				
			 | 
			
				391
			 | 
			
			
				+backup_certs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				392
			 | 
			
			
				+backup_mailing_list 
			 | 
		
	
		
			
			| 
				
			 | 
			
				393
			 | 
			
			
				+backup_xmpp 
			 | 
		
	
		
			
			| 
				
			 | 
			
				394
			 | 
			
			
				+backup_web_server 
			 | 
		
	
		
			
			| 
				
			 | 
			
				395
			 | 
			
			
				+backup_admin_readme 
			 | 
		
	
		
			
			| 
				
			 | 
			
				396
			 | 
			
			
				+backup_ipfs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				397
			 | 
			
			
				+backup_dlna 
			 | 
		
	
		
			
			| 
				
			 | 
			
				398
			 | 
			
			
				+backup_voip 
			 | 
		
	
		
			
			| 
				
			 | 
			
				399
			 | 
			
			
				+backup_tox 
			 | 
		
	
		
			
			| 
				
			 | 
			
				400
			 | 
			
			
				+backup_mariadb 
			 | 
		
	
		
			
			| 
				361
			 | 
			
				401
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				362
			 | 
			
				402
			 | 
			
			
				 # For each remote server 
			 | 
		
	
		
			
			| 
				363
			 | 
			
				403
			 | 
			
			
				 while read remote_server 
			 |