This commit is contained in:
Your Name 2023-02-21 07:18:07 -07:00
parent 90a40b2f2f
commit 6b53bac1d4

View File

@ -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