Browse Source

Local backup for mumble

Bob Mottram 8 years ago
parent
commit
278440a39c
No account linked to committer's email
4 changed files with 33 additions and 22 deletions
  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 View File

50
 }
50
 }
51
 
51
 
52
 function backup_local_gogs {
52
 function backup_local_gogs {
53
-	GIT_DOMAIN_NAME='gogs'
54
 	if grep -q "Gogs domain" $COMPLETION_FILE; then
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
 function backup_remote_gogs {
73
 function backup_remote_gogs {

+ 3
- 3
src/freedombone-app-irc View File

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

+ 4
- 4
src/freedombone-app-mediagoblin View File

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

+ 13
- 3
src/freedombone-app-mumble View File

40
 VOIP_CONFIG_FILE="mumble-server.ini"
40
 VOIP_CONFIG_FILE="mumble-server.ini"
41
 
41
 
42
 function upgrade_mumble {
42
 function upgrade_mumble {
43
-    echo ''
43
+	echo -n ''
44
 }
44
 }
45
 
45
 
46
 function backup_local_mumble {
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
 function backup_remote_mumble {
60
 function backup_remote_mumble {
51
-    echo ''
61
+	echo ''
52
 }
62
 }
53
 
63
 
54
 function remove_mumble {
64
 function remove_mumble {