Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Rollback STABLE -> TESTING
- # ---------------------------
- # Rollback - Btrfs
- # ---------------------------
- BTRFS=/usr/bin/btrfs
- CP=/usr/bin/cp
- ECHO=/usr/bin/echo
- GREP=/usr/bin/grep
- MOUNT=/usr/bin/mount
- MV=/usr/bin/mv
- PACAUR=/usr/bin/pacaur
- PACMAN=/usr/bin/pacman
- REFLECTOR=/usr/bin/reflector
- SED=/usr/bin/sed
- SUDO=/usr/bin/sudo
- # ---------------------------
- # Rollback System
- # ---------------------------
- bootstate=`$MOUNT | $GREP "on / type btrfs" | $GREP "subvol=/@snapshots/STABLE"`
- if [ -z $"{bootstate}" ]
- then
- $ECHO ""
- $ECHO $bootstate
- $ECHO ""
- $ECHO "System ist nicht mit STABLE hochgefahren !"
- $ECHO "ENDE !"
- exit
- else
- # --------- ROLLBACK - STABLE -> TESTING ----------
- $SUDO $BTRFS subvolume delete /.snapshots/TESTING
- $SUDO $BTRFS subvolume snapshot / /.snapshots/TESTING
- $SUDO $SED -i 's/STABLE/TESTING/g' /.snapshots/TESTING/etc/fstab
- $SUDO $CP /boot/vmlinuz-linux-stable /boot/vmlinuz-linux
- $SUDO $CP /boot/initramfs-linux-stable.img /boot/initramfs-linux.img
- # ---------------------------
- # Balance Filesystem
- # --------------------------
- $SUDO $BTRFS balance start -dusage=5 /btrfs
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement