From 278440a39cb759099d65d3e658c94a094a528c5e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 7 Jul 2016 12:12:33 +0100 Subject: [PATCH] Local backup for mumble --- src/freedombone-app-gogs | 31 ++++++++++++++++--------------- src/freedombone-app-irc | 6 +++--- src/freedombone-app-mediagoblin | 8 ++++---- src/freedombone-app-mumble | 16 +++++++++++++--- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/freedombone-app-gogs b/src/freedombone-app-gogs index cc4534b2..f4944f85 100755 --- a/src/freedombone-app-gogs +++ b/src/freedombone-app-gogs @@ -50,23 +50,24 @@ function upgrade_gogs { } function backup_local_gogs { - GIT_DOMAIN_NAME='gogs' if grep -q "Gogs domain" $COMPLETION_FILE; then - GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}') + if [ -d /home/git/gogs-repositories ]; then + GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}') + + echo $"Backing up gogs" + + function_check backup_database_local + backup_database_local gogs + + function_check backup_directory_to_usb + backup_directory_to_usb /root/tempgogsdata gogsdata + backup_directory_to_usb $GOPATH/src/github.com/gogits/gogs/custom gogs + backup_directory_to_usb /home/git/gogs-repositories gogsrepos + backup_directory_to_usb /home/git/.ssh gogsssh + + echo $"Gogs backup complete" + fi fi - - echo $"Backing up gogs" - - function_check backup_database_local - backup_database_local gogs - - function_check backup_directory_to_usb - backup_directory_to_usb /root/tempgogsdata gogsdata - backup_directory_to_usb $GOPATH/src/github.com/gogits/gogs/custom gogs - backup_directory_to_usb /home/git/gogs-repositories gogsrepos - backup_directory_to_usb /home/git/.ssh gogsssh - - echo $"Gogs backup complete" } function backup_remote_gogs { diff --git a/src/freedombone-app-irc b/src/freedombone-app-irc index 2f61542e..e618f207 100755 --- a/src/freedombone-app-irc +++ b/src/freedombone-app-irc @@ -37,15 +37,15 @@ IRC_ONION_PORT=6697 IRC_PASSWORD= function upgrade_irc { - echo '' + echo -n '' } function backup_local_irc { - echo '' + echo -n '' } function backup_remote_irc { - echo '' + echo -n '' } function remove_irc { diff --git a/src/freedombone-app-mediagoblin b/src/freedombone-app-mediagoblin index 17657720..a83e2f91 100755 --- a/src/freedombone-app-mediagoblin +++ b/src/freedombone-app-mediagoblin @@ -38,19 +38,19 @@ MEDIAGOBLIN_ADMIN_PASSWORD= MEDIAGOBLIN_ONION_PORT=8096 function upgrade_mediagoblin { - echo '' + echo -n '' } function backup_local_mediagoblin { - echo '' + echo -n '' } function backup_remote_mediagoblin { - echo '' + echo -n '' } function remove_mediagoblin { - echo '' + echo -n '' } function install_mediagoblin { diff --git a/src/freedombone-app-mumble b/src/freedombone-app-mumble index 34ec7583..6f44e13a 100755 --- a/src/freedombone-app-mumble +++ b/src/freedombone-app-mumble @@ -40,15 +40,25 @@ VOIP_DATABASE="mumble-server.sqlite" VOIP_CONFIG_FILE="mumble-server.ini" function upgrade_mumble { - echo '' + echo -n '' } function backup_local_mumble { - echo '' + if [ -f /etc/mumble-server.ini ]; then + echo $"Backing up Mumble settings" + if [ ! -d /root/tempvoipbackup ]; then + mkdir -p /root/tempvoipbackup + fi + cp -f /etc/mumble-server.ini /root/tempvoipbackup + cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup + cp -f /etc/sipwitch.conf /root/tempvoipbackup + backup_directory_to_usb /root/tempvoipbackup voip + echo $"Mumble settings backup complete" + fi } function backup_remote_mumble { - echo '' + echo '' } function remove_mumble {