浏览代码

Local backup for mumble

Bob Mottram 8 年前
父节点
当前提交
278440a39c
没有帐户链接到提交者的电子邮件
共有 4 个文件被更改,包括 33 次插入22 次删除
  1. 13
    12
      src/freedombone-app-gogs
  2. 3
    3
      src/freedombone-app-irc
  3. 4
    4
      src/freedombone-app-mediagoblin
  4. 13
    3
      src/freedombone-app-mumble

+ 13
- 12
src/freedombone-app-gogs 查看文件

@@ -50,23 +50,24 @@ function upgrade_gogs {
50 50
 }
51 51
 
52 52
 function backup_local_gogs {
53
-	GIT_DOMAIN_NAME='gogs'
54 53
 	if grep -q "Gogs domain" $COMPLETION_FILE; then
55
-		GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}')
56
-	fi
54
+		if [ -d /home/git/gogs-repositories ]; then
55
+			GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}')
57 56
 
58
-	echo $"Backing up gogs"
57
+			echo $"Backing up gogs"
59 58
 
60
-	function_check backup_database_local
61
-	backup_database_local gogs
59
+			function_check backup_database_local
60
+			backup_database_local gogs
62 61
 
63
-	function_check backup_directory_to_usb
64
-	backup_directory_to_usb /root/tempgogsdata gogsdata
65
-	backup_directory_to_usb $GOPATH/src/github.com/gogits/gogs/custom gogs
66
-	backup_directory_to_usb /home/git/gogs-repositories gogsrepos
67
-	backup_directory_to_usb /home/git/.ssh gogsssh
62
+			function_check backup_directory_to_usb
63
+			backup_directory_to_usb /root/tempgogsdata gogsdata
64
+			backup_directory_to_usb $GOPATH/src/github.com/gogits/gogs/custom gogs
65
+			backup_directory_to_usb /home/git/gogs-repositories gogsrepos
66
+			backup_directory_to_usb /home/git/.ssh gogsssh
68 67
 
69
-	echo $"Gogs backup complete"
68
+			echo $"Gogs backup complete"
69
+		fi
70
+	fi
70 71
 }
71 72
 
72 73
 function backup_remote_gogs {

+ 3
- 3
src/freedombone-app-irc 查看文件

@@ -37,15 +37,15 @@ IRC_ONION_PORT=6697
37 37
 IRC_PASSWORD=
38 38
 
39 39
 function upgrade_irc {
40
-    echo ''
40
+    echo -n ''
41 41
 }
42 42
 
43 43
 function backup_local_irc {
44
-	echo ''
44
+	echo -n ''
45 45
 }
46 46
 
47 47
 function backup_remote_irc {
48
-	echo ''
48
+	echo -n ''
49 49
 }
50 50
 
51 51
 function remove_irc {

+ 4
- 4
src/freedombone-app-mediagoblin 查看文件

@@ -38,19 +38,19 @@ MEDIAGOBLIN_ADMIN_PASSWORD=
38 38
 MEDIAGOBLIN_ONION_PORT=8096
39 39
 
40 40
 function upgrade_mediagoblin {
41
-    echo ''
41
+    echo -n ''
42 42
 }
43 43
 
44 44
 function backup_local_mediagoblin {
45
-    echo ''
45
+    echo -n ''
46 46
 }
47 47
 
48 48
 function backup_remote_mediagoblin {
49
-    echo ''
49
+    echo -n ''
50 50
 }
51 51
 
52 52
 function remove_mediagoblin {
53
-    echo ''
53
+    echo -n ''
54 54
 }
55 55
 
56 56
 function install_mediagoblin {

+ 13
- 3
src/freedombone-app-mumble 查看文件

@@ -40,15 +40,25 @@ VOIP_DATABASE="mumble-server.sqlite"
40 40
 VOIP_CONFIG_FILE="mumble-server.ini"
41 41
 
42 42
 function upgrade_mumble {
43
-    echo ''
43
+	echo -n ''
44 44
 }
45 45
 
46 46
 function backup_local_mumble {
47
-    echo ''
47
+	if [ -f /etc/mumble-server.ini ]; then
48
+		echo $"Backing up Mumble settings"
49
+		if [ ! -d /root/tempvoipbackup ]; then
50
+			mkdir -p /root/tempvoipbackup
51
+		fi
52
+		cp -f /etc/mumble-server.ini /root/tempvoipbackup
53
+		cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup
54
+		cp -f /etc/sipwitch.conf /root/tempvoipbackup
55
+		backup_directory_to_usb /root/tempvoipbackup voip
56
+		echo $"Mumble settings backup complete"
57
+	fi
48 58
 }
49 59
 
50 60
 function backup_remote_mumble {
51
-    echo ''
61
+	echo ''
52 62
 }
53 63
 
54 64
 function remove_mumble {