From 08845cec6393482a60493e465f0ba13727386f5b Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 8 May 2016 20:22:16 +0200 Subject: bin/set_volume: Making script not depend on functions.sh anymore. Introducing bash strict mode. --- bin/rollback-profile | 69 ---------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100755 bin/rollback-profile (limited to 'bin/rollback-profile') 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 -- cgit v1.2.3-54-g00ecf