Added gum
This commit is contained in:
parent
49093fef5d
commit
3ebe8dc891
@ -38,38 +38,32 @@ _isInstalledYay() {
|
|||||||
# Confirm Start
|
# Confirm Start
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
while true; do
|
if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then
|
||||||
read -p "DO YOU WANT TO START THE UPDATE NOW? (Yy/Nn): " yn
|
echo "Update started."
|
||||||
case $yn in
|
elif [ $? -eq 130 ]; then
|
||||||
[Yy]* )
|
exit 130
|
||||||
echo ""
|
else
|
||||||
break;;
|
echo "Update canceled."
|
||||||
[Nn]* )
|
exit;
|
||||||
exit;
|
fi
|
||||||
break;;
|
echo ""
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $(_isInstalledYay "Timeshift") == 1 ]];
|
if [[ $(_isInstalledYay "Timeshift") == 1 ]] ;then
|
||||||
then
|
if gum confirm "DO YOU WANT TO CREATE A SNAPSHOT?" ;then
|
||||||
while true; do
|
echo ""
|
||||||
read -p "DO YOU WANT TO CREATE A SNAPSHOT? (Yy/Nn): " yn
|
c=$(gum input --placeholder "Enter a comment for the snapshot...")
|
||||||
case $yn in
|
sudo timeshift --create --comments "$c"
|
||||||
[Yy]* )
|
sudo timeshift --list
|
||||||
echo ""
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
read -p "Enter a comment for the snapshot: " c
|
echo "DONE. Snapshot $c created!"
|
||||||
sudo timeshift --create --comments "$c"
|
echo ""
|
||||||
sudo timeshift --list
|
elif [ $? -eq 130 ]; then
|
||||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
echo "Snapshot canceled."
|
||||||
echo "DONE. Snapshot $c created!"
|
exit 130
|
||||||
echo ""
|
else
|
||||||
break;;
|
echo "Snapshot canceled."
|
||||||
[Nn]* )
|
fi
|
||||||
break;;
|
echo ""
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "-----------------------------------------------------"
|
echo "-----------------------------------------------------"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# by Stephan Raabe (2023)
|
# by Stephan Raabe (2023)
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
|
|
||||||
read -p "Enter a comment for the snapshot: " c
|
c=$(gum input --placeholder "Enter a comment for the snapshot...")
|
||||||
sudo timeshift --create --comments "$c"
|
sudo timeshift --create --comments "$c"
|
||||||
sudo timeshift --list
|
sudo timeshift --list
|
||||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
Loading…
Reference in New Issue
Block a user