This commit is contained in:
Your Name 2024-09-01 22:26:47 +00:00
parent 09e9d5d674
commit 4b31f2956c

View File

@ -139,23 +139,6 @@ osSnapshots() {
chown $USER:$USER $1/$2.tgz
}
homeBackup() {
echo
echo "[Copying USER data from /home to $TARGET/@home]"
echo
rsync -a --delete /home/ --exclude=.cache --exclude=.local/share/flatpak --exclude=.local/share/containers $TARGET/\@home/
}
osBackup() {
umount $TARGET
osSnapshots "$1" "$2"
ls $TARGET/
umount $TARGET
cryptsetup close $ROOT_MAPPER_NAME
}
osRestore() {
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
@ -667,8 +650,7 @@ tweaks() {
echo "[2] Chroot into existing OS"
echo "[3] Compile the Kernel"
echo "[4] Upgrade gentoo.sh"
echo "[5] Restore Live OS to removable media"
echo "[6] Enable/Disable Disk Password at Boot"
echo "[5] Enable/Disable Disk Password at Boot"
echo
read -p 'Your Choice: ' choice
if [[ $choice = 1 ]]; then
@ -687,9 +669,6 @@ tweaks() {
rm -f /tmp/latest-stage3-amd64-desktop-systemd.txt
wget https://git.poster.place/verita84/sway/raw/branch/main/gentoo.sh
elif [[ $choice = 5 ]]; then
setDevices
liveOSrestore "$HARD_DISK" $ROOT_MAPPER_NAME "none" "none" "$ROOT_NAME"
elif [[ $choice = 6 ]]; then
clear
echo "[Password Protection at Boot]"
echo
@ -751,10 +730,9 @@ menu() {
echo "[2] Download Gentoo Installation Files"
echo "[3] Install System"
echo "[4] Automatic Install"
echo "[5] Backup"
echo "[6] Restore"
echo "[7] Tools and Tweaks"
echo "[8] Initialize Disk"
echo "[5] Backup/Restore Live OS to/from removable media"
echo "[6] Tools and Tweaks"
echo "[7] Initialize Disk"
echo
read -p 'Your Choice: ' choice
@ -778,31 +756,12 @@ menu() {
exit 1
elif [[ $choice = 5 ]]; then
clear
echo "[Backup OS]"
echo
read -p 'OS Backup Directory Location : ' -e -i "/tmp" backup_directory
osBackup $backup_directory "$ROOT_NAME"
elif [[ $choice = 6 ]]; then
clear
echo "[Restore from Backup]"
echo
echo
rm -f /tmp/disk
setDevices
read -p 'Hostname for Restore: ' -e -i "gentoo" HOSTNAME
read -p 'Restore Directory Image Source: ' -e -i "/mnt" restore_directory
FILE_SCAN=$(ls $restore_directory/gentoo-$HOSTNAME-* | tail -1)
read -p 'Restore Home Directory? : ' -e -i 'n' home_restore
read -p 'Backup file name to restore: ' -e -i "$FILE_SCAN" backup_name
if [[ $home_restore = *n* ]]; then
osRestore "$HARD_DISK" "$backup_name" "none" "$restore_directory" "$BTRFS"
else
osRestore "$HARD_DISK" "$backup_name" "home" "$restore_directory" "$BTRFS"
fi
elif [[ $choice = 7 ]]; then
setDevices
liveOSrestore "$HARD_DISK" $ROOT_MAPPER_NAME "none" "none" "$ROOT_NAME"
elif [[ $choice = 6 ]]; then
tweaks
elif [[ $choice = 8 ]]; then
elif [[ $choice = 7 ]]; then
clear
echo "[Initialize Disk]"
echo