aboutsummaryrefslogtreecommitdiffstats
path: root/bin/rollback-profile
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-05-08 20:22:16 +0200
committerDavid Runge <dave@sleepmap.de>2016-05-08 20:22:16 +0200
commit08845cec6393482a60493e465f0ba13727386f5b (patch)
tree8282cffd99ca2a12dfb3d34a7f82a28ac26d71b5 /bin/rollback-profile
parent9cfb64c997b8e5f095c75f39641762f44d3307c2 (diff)
downloaddotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.gz
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.bz2
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.xz
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.zip
bin/set_volume: Making script not depend on functions.sh anymore. Introducing bash strict mode.
Diffstat (limited to 'bin/rollback-profile')
-rwxr-xr-xbin/rollback-profile69
1 files changed, 0 insertions, 69 deletions
diff --git a/bin/rollback-profile b/bin/rollback-profile
deleted file mode 100755
index 81386b3..0000000
--- a/bin/rollback-profile
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-#
-# Rollback a thunderbird or firefox profile backup from store location while gpg decrypting
-#
-
-# Checking if firefox and/ or thunderbird are running.
-firefoxPID=`ps -C firefox -o pid=`
-thunderbirdPID=`ps -C thunderbird -o pid=`
-
-firefoxTMP=/tmp/firefox.tgz
-thunderbirdTMP=/tmp/thunderbird.tgz
-firefoxIF=~/.mozilla/firefox/
-thunderbirdIF=~/.thunderbird/
-profileName=dvzrv
-backupEND=-rollback
-OF=~/ownCloud/backup/web/
-gpgEND=.gpg
-tgzEND=.tgz
-
-case $1 in
- "thunderbird")
- if [[ -z "$thunderbirdPID" ]]
- then
- echo "Thunderbird is not running."
- echo "Rolling back profile backup."
- echo "Copying backup to /tmp and moving old profile to rollback location."
- cp $OF$1$tgzEND$gpgEND $thunderbirdTMP$gpgEND
- mv $thunderbirdIF$profileName $thunderbirdIF$profileName$backupEND
- echo "Decrypting file."
- gpg -o $thunderbirdTMP -d $thunderbirdTMP$gpgEND
- echo "Extracting files from tar."
- tar xzvf $thunderbirdTMP -C $thunderbirdIF
- echo "Cleaning up."
- rm $thunderbirdTMP $thunderbirdTMP$gpgEND
- echo "Done."
- else
- echo "Thunderbird is still running."
- echo "Skipping rollback."
- fi
- ;;
- "firefox")
- if [[ -z "$firefoxPID" ]]
- then
- echo "Firefox is not running."
- psdStopped=`systemctl status psd |grep inactive`
- if [[ ! -z "$psdStopped" ]]; then
- echo "Psd daemon is inactive."
- echo "Rolling back profile backup."
- echo "Copying backup to /tmp and moving old profile to rollback location."
- cp $OF$1$tgzEND$gpgEND $firefoxTMP$gpgEND
- mv $firefoxIF$profileName $firefoxIF$profileName$backupEND
- echo "Decrypting file."
- gpg -o $firefoxTMP -d $firefoxTMP$gpgEND
- echo "Extracting files from tar."
- tar xzvf $firefoxTMP -C $firefoxIF
- echo "Cleaning up."
- rm $firefoxTMP $firefoxTMP$gpgEND
- echo "Done."
- else
- echo "Psd service is still running!"
- echo "Disable it using: 'systemctl stop psd'."
- echo "Skipping rollback."
- fi
- else
- echo "Firefox is still running."
- echo "Skipping rollback."
- fi
- ;;
-esac