|
@@ -1204,37 +1204,52 @@ function restore_voip {
|
1204
|
1204
|
fi
|
1205
|
1205
|
if [ -d $USB_MOUNT/backup/voip ]; then
|
1206
|
1206
|
echo $"Restoring VoIP settings"
|
1207
|
|
- restore_directory_from_usb /root/tempvoip voip
|
1208
|
|
- cp -f /root/tempvoip/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/
|
|
1207
|
+ temp_restore_dir=/root/tempvoip
|
|
1208
|
+ restore_directory_from_usb $temp_restore_dir voip
|
|
1209
|
+ cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.ini /etc/
|
1209
|
1210
|
if [ ! "$?" = "0" ]; then
|
1210
|
|
- rm -rf /root/tempvoip
|
|
1211
|
+ rm -rf $temp_restore_dir
|
1211
|
1212
|
set_user_permissions
|
1212
|
1213
|
backup_unmount_drive
|
1213
|
1214
|
exit 3679
|
1214
|
1215
|
fi
|
1215
|
|
- cp -f /root/tempvoip/home/$ADMIN_USERNAME/tempbackup/sipwitch.conf /etc/sipwitch.conf
|
|
1216
|
+ cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/mumble-server.sqlite /var/lib/mumble-server/
|
1216
|
1217
|
if [ ! "$?" = "0" ]; then
|
1217
|
|
- rm -rf /root/tempvoip
|
1218
|
|
- set_user_permissions
|
1219
|
|
- backup_unmount_drive
|
1220
|
|
- exit 3679
|
1221
|
|
- fi
|
1222
|
|
- cp -f /root/tempvoip/home/$ADMIN_USERNAME/tempbackup/mumble-server.sqlite /var/lib/mumble-server/
|
1223
|
|
- if [ ! "$?" = "0" ]; then
|
1224
|
|
- rm -rf /root/tempvoip
|
|
1218
|
+ rm -rf $temp_restore_dir
|
1225
|
1219
|
set_user_permissions
|
1226
|
1220
|
backup_unmount_drive
|
1227
|
1221
|
exit 276
|
1228
|
1222
|
fi
|
1229
|
|
- rm -rf /root/tempvoip
|
|
1223
|
+ rm -rf $temp_restore_dir
|
1230
|
1224
|
cp /etc/ssl/certs/mumble* /var/lib/mumble-server
|
1231
|
1225
|
cp /etc/ssl/private/mumble* /var/lib/mumble-server
|
1232
|
1226
|
chown -R mumble-server:mumble-server /var/lib/mumble-server
|
1233
|
|
- service sipwitch restart
|
1234
|
1227
|
service mumble-server restart
|
1235
|
1228
|
fi
|
1236
|
1229
|
}
|
1237
|
1230
|
|
|
1231
|
+function restore_sip {
|
|
1232
|
+ if [[ $RESTORE_APP != 'all' ]]; then
|
|
1233
|
+ if [[ $RESTORE_APP != 'sip' ]]; then
|
|
1234
|
+ return
|
|
1235
|
+ fi
|
|
1236
|
+ fi
|
|
1237
|
+ if [ -d $USB_MOUNT/backup/sip ]; then
|
|
1238
|
+ echo $"Restoring SIP settings"
|
|
1239
|
+ temp_restore_dir=/root/tempsip
|
|
1240
|
+ restore_directory_from_usb $temp_restore_dir sip
|
|
1241
|
+ cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/sipwitch.conf /etc/sipwitch.conf
|
|
1242
|
+ if [ ! "$?" = "0" ]; then
|
|
1243
|
+ rm -rf $temp_restore_dir
|
|
1244
|
+ set_user_permissions
|
|
1245
|
+ backup_unmount_drive
|
|
1246
|
+ exit 3679
|
|
1247
|
+ fi
|
|
1248
|
+ rm -rf $temp_restore_dir
|
|
1249
|
+ service sipwitch restart
|
|
1250
|
+ fi
|
|
1251
|
+}
|
|
1252
|
+
|
1238
|
1253
|
function restore_tox {
|
1239
|
1254
|
if [[ $RESTORE_APP != 'all' ]]; then
|
1240
|
1255
|
if [[ $RESTORE_APP != 'tox' ]]; then
|
|
@@ -1269,6 +1284,26 @@ function get_restore_app {
|
1269
|
1284
|
fi
|
1270
|
1285
|
}
|
1271
|
1286
|
|
|
1287
|
+function restore_apps {
|
|
1288
|
+ FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
|
|
1289
|
+
|
|
1290
|
+ APPS_COMPLETED=()
|
|
1291
|
+
|
|
1292
|
+ # for all the app scripts
|
|
1293
|
+ for filename in $FILES
|
|
1294
|
+ do
|
|
1295
|
+ app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
|
1296
|
+ if [[ $(item_in_array ${app_name} ${APPS_COMPLETED[@]}) != 0 ]]; then
|
|
1297
|
+ function_check app_is_installed
|
|
1298
|
+ if [[ "$(app_is_installed $a)" == "1" ]]; then
|
|
1299
|
+ APPS_COMPLETED+=("${app_name}")
|
|
1300
|
+ function_check restore_local_${app_name}
|
|
1301
|
+ restore_local_${app_name}
|
|
1302
|
+ fi
|
|
1303
|
+ fi
|
|
1304
|
+ done
|
|
1305
|
+}
|
|
1306
|
+
|
1272
|
1307
|
get_restore_app ${2}
|
1273
|
1308
|
backup_mount_drive ${1} ${ADMIN_USERNAME} ${2}
|
1274
|
1309
|
check_backup_exists
|
|
@@ -1285,7 +1320,6 @@ restore_gpg
|
1285
|
1320
|
restore_procmail
|
1286
|
1321
|
restore_spamassassin
|
1287
|
1322
|
restore_admin_readme
|
1288
|
|
-restore_ipfs
|
1289
|
1323
|
restore_user_ssh_keys
|
1290
|
1324
|
restore_user_config
|
1291
|
1325
|
restore_user_emacs
|
|
@@ -1295,6 +1329,8 @@ restore_user_local
|
1295
|
1329
|
restore_certs
|
1296
|
1330
|
restore_personal_settings
|
1297
|
1331
|
restore_mailing_list
|
|
1332
|
+
|
|
1333
|
+restore_ipfs
|
1298
|
1334
|
restore_xmpp
|
1299
|
1335
|
restore_gnusocial
|
1300
|
1336
|
restore_hubzilla
|
|
@@ -1308,7 +1344,10 @@ restore_cjdns
|
1308
|
1344
|
restore_email
|
1309
|
1345
|
restore_dlna
|
1310
|
1346
|
restore_voip
|
|
1347
|
+restore_sip
|
1311
|
1348
|
restore_tox
|
|
1349
|
+
|
|
1350
|
+restore_apps
|
1312
|
1351
|
set_user_permissions
|
1313
|
1352
|
backup_unmount_drive
|
1314
|
1353
|
|