add timeshift snapshot to update&shutdown

This commit is contained in:
Carlos Sousa 2025-03-13 10:47:43 +01:00
parent e4879054a0
commit 0c6449302e

View File

@ -22,6 +22,25 @@ echo ""
echo "sudo permissions available. Starting"
echo ""
if which "timeshift" &> /dev/null; then
echo ""
echo "Making snapshot with timeshift"
echo ""
sudo timeshift --create --comments "Pre Updates"
else
echo ""
echo "timeshift is not installed."
echo "continuining without making a snapshot"
echo ""
fi
echo ""
echo "Starting Updates"
echo ""
sudo dnf clean all -y
sudo dnf check -y
sudo dnf check-update -y
sudo dnf update -y
@ -29,11 +48,10 @@ sudo flatpak update -y
sudo flatpak repair
sudo flatpak uninstall --unused -y
sudo dnf autoremove -y
sudo dnf clean all -y
echo ""
echo "Press any key withing $SHUTDOWN_TIMEOUT seconds to cancel shutdown."
echo "Press any key within $SHUTDOWN_TIMEOUT seconds to cancel shutdown."
echo ""
if read -t $SHUTDOWN_TIMEOUT -n 1; then