From 6b53bac1d457c092070730adffbc52c5a338d6af Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 21 Feb 2023 07:18:07 -0700 Subject: [PATCH] fix --- debian.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/debian.sh b/debian.sh index 9745fef..af9b6bf 100755 --- a/debian.sh +++ b/debian.sh @@ -140,11 +140,15 @@ os-restore() { BACKUP_DISK_IMAGES="/var/backups" fi + if [ "${3}" ]; then + BACKUP_DISK_IMAGES="${3}" + fi + partitions rm -rf $TARGET/usr $TARGET/sbin $TARGET/lib32 $TARGET/libx32 $TARGET/lib $TARGET/vmlinuz* $TARGET/initrd* $TARGET/bin $TARGET/var $TARGET/root $TARGET/opt $TARGET/etc $TARGET/run - echo "[Restirubg OS tarfile from $BACKUP_DISK_IMAGES/$1.tgz]" + echo "[Restoring OS tarfile from $BACKUP_DISK_IMAGES/$1.tgz]" echo - tar xfpv $BACKUP_DISK_IMAGES/$2.tgz -C $TARGET/ + tar xfp $BACKUP_DISK_IMAGES/$2.tgz -C $TARGET/ if [ "$3" = "home" ]; then rsync -a --delete /home/ $TARGET/home/ @@ -519,7 +523,7 @@ show-help() { echo echo "./debian.sh install [disk]" echo "./debian.sh backup [device name] [home]" - echo "./debian.sh restore [disk] [backup name] [home]" + echo "./debian.sh restore [disk] [backup name] [home] [tar dir]" echo "./debian.sh chroot [disk]" echo "./debian.sh wifi" echo "./debian.sh bootloader [disk]" @@ -564,7 +568,7 @@ elif [ "$1" = "grub-snapshots" ]; then elif [ "$1" = "btrfs-tweaks" ]; then btrfs-tweaks elif [ "$1" = "restore" ]; then - os-restore "$2" "$3" "$4" + os-restore "$2" "$3" "$4" "$5" elif [ "$1" = "remove-snapshot" ]; then remove-snapshots elif [ "$1" = "help" ]; then