#!/bin/bash # restore: decrypt this directory # are there any encrypted contents? if [ ! -e store.tar.gpg ] then echo -e "\astore.tar.gpg does not exist in this directory `pwd`" echo "nothing done" exit 1 fi # if files added since store, make sure they are safe when extract store if [ $(/bin/ls|grep -v store.tar.gpg|wc -l) -gt 0 ] then echo -e "\007store.tar.gpg is not alone in this directory" echo "nothing done" exit 1 fi gpg --output - store.tar.gpg|tar -x -v -f - rm store.tar.gpg echo "completed restore of encrypted directory $(pwd)" exit 0