minor fixes

This commit is contained in:
snaki 2022-07-07 14:38:09 +02:00
parent cd6dfdda40
commit 8c33429170

23
btrbk
View file

@ -66,13 +66,19 @@ function runFullRestore {
esac esac
echo "Specify the remote path with trailing slash [remote:/path/to/backupdir/]" echo "Specify the remote path with trailing slash [remote:/path/to/backupdir/]"
read -r -p "Dir: " rcloneDir read -r -p "Dir: " rcloneDir
rclone copy $rcloneDir"config/btrbk.conf" /etc/btrbk.conf read -r -p "Import GPG key?[y/N]: " gpgtest
echo "Enter Path of your gpg public and secret key" case "$gpgtest" in
read -r -p "Publickey: " gpgPub [yY])
read -r -p "Secretkey: " gpgPriv echo "Enter Path of your gpg public and secret key"
gpg --import $gpgPub read -r -p "Publickey: " gpgPub
gpg --import $gpgPriv read -r -p "Secretkey: " gpgPriv
gpg --import $gpgPub
gpg --pinentry-mode loopback --import $gpgPriv;;
*) ;;
esac
if ! [ -e "/etc/btrbk.conf" ]; then
rclone copy $rcloneDir"config/btrbk.conf" "/etc/btrbk.conf"
fi
source /etc/btrbk.conf source /etc/btrbk.conf
local bkSuffix=("${INCR[0]}" "${FULL[0]}") local bkSuffix=("${INCR[0]}" "${FULL[0]}")
btrfs subvolume create $restoreDir"restore" btrfs subvolume create $restoreDir"restore"
@ -161,12 +167,11 @@ while true; do
-r|--restore) restore=1; restoreVol=$2; shift;; -r|--restore) restore=1; restoreVol=$2; shift;;
-x|--full-restore) fullRestore=1; restoreDir=$2; shift;; -x|--full-restore) fullRestore=1; restoreDir=$2; shift;;
-h|--help) Help; shift; break;; -h|--help) Help; shift; break;;
--) shift; echoHelp;; --) shift; break;;
\?) echo "error"; exit 1;; \?) echo "error"; exit 1;;
esac esac
shift shift
done done
echo $fullRestore
if [ $fullRestore = "1" ]; then if [ $fullRestore = "1" ]; then
runFullRestore runFullRestore
else else