瀏覽代碼

Move sip local restore to spp script

Bob Mottram 8 年之前
父節點
當前提交
6754e540fd
共有 2 個文件被更改,包括 23 次插入23 次删除
  1. 23
    0
      src/freedombone-app-sip
  2. 0
    23
      src/freedombone-restore-local

+ 23
- 0
src/freedombone-app-sip 查看文件

@@ -57,10 +57,33 @@ function backup_local_sip {
57 57
 	fi
58 58
 }
59 59
 
60
+function restore_local_sip {
61
+	if [ -d $USB_MOUNT/backup/sip ]; then
62
+		echo $"Restoring SIP settings"
63
+		temp_restore_dir=/root/tempsip
64
+		function_check restore_directory_from_usb
65
+		restore_directory_from_usb $temp_restore_dir sip
66
+		cp -f $temp_restore_dir/home/$ADMIN_USERNAME/tempbackup/sipwitch.conf /etc/sipwitch.conf
67
+		if [ ! "$?" = "0" ]; then
68
+			rm -rf $temp_restore_dir
69
+			function_check set_user_permissions
70
+			set_user_permissions
71
+			backup_unmount_drive
72
+			exit 3679
73
+		fi
74
+		rm -rf $temp_restore_dir
75
+		service sipwitch restart
76
+	fi
77
+}
78
+
60 79
 function backup_remote_sip {
61 80
 	echo -n ''
62 81
 }
63 82
 
83
+function restore_remote_sip {
84
+	echo -n ''
85
+}
86
+
64 87
 function remove_sip {
65 88
 	if ! grep -Fxq "install_sip" $COMPLETION_FILE; then
66 89
 		return

+ 0
- 23
src/freedombone-restore-local 查看文件

@@ -1228,28 +1228,6 @@ function restore_voip {
1228 1228
 	fi
1229 1229
 }
1230 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
-
1253 1231
 function restore_tox {
1254 1232
 	if [[ $RESTORE_APP != 'all' ]]; then
1255 1233
 		if [[ $RESTORE_APP != 'tox' ]]; then
@@ -1344,7 +1322,6 @@ restore_cjdns
1344 1322
 restore_email
1345 1323
 restore_dlna
1346 1324
 restore_voip
1347
-restore_sip
1348 1325
 restore_tox
1349 1326
 
1350 1327
 restore_apps