#!/bin/sh firefoxPID=`ps -C firefox -o pid=` thunderbirdPID=`ps -C thunderbird -o pid=` firefoxTMP=/tmp/firefox.tgz thunderbirdTMP=/tmp/thunderbird.tgz firefoxIF=~/.mozilla/firefox/dvzrv thunderbirdIF=~/.thunderbird/dvzrv OF=~/Dropbox/sync gpgEND=.gpg if [[ -z "$firefoxPID" ]] then echo "Firefox is not running." echo "Backing up profile." tar cfPzh $firefoxTMP $firefoxIF echo "Encrypting profile." gpg -e -r 'David Runge ' $firefoxTMP echo "Moving backup to Dropbox." mv -f $firefoxTMP$gpgEND $OF echo "Cleaning up." rm $firefoxTMP echo "Done." else echo "Firefox is still running." echo "Skipping backup." fi if [[ -z "$thunderbirdPID" ]] then echo "Thunderbird is not running." echo "Backing up profile." tar cfPz $thunderbirdTMP $thunderbirdIF echo "Encrypting profile." gpg -e -r 'David Runge ' $thunderbirdTMP echo "Moving backup to Dropbox." mv -f $thunderbirdTMP$gpgEND $OF echo "Cleaning up." rm $thunderbirdTMP echo "Done." else echo "Thunderbird is still running." echo "Skipping backup." fi