Perl Nopaste Service

Download: Here New: Here

Nopaste from: Sun Nov 24 21:50:00 2019

Expires on: never

From: Anonymous (91.58.148.151)

Code language: Plain

Description: unicks.eu https://www.dropbox.com/s/ju13bjbw09...update.sh?dl=0 update.sh

Code:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
#!/bin/bash
# System Update
# ---------------------------
# Snapshot - Rollback - Btrfs
# ---------------------------

MV=/usr/bin/mv
BTRFS=/usr/bin/btrfs
SED=/usr/bin/sed
PACMAN=/usr/bin/pacman
PACAUR=/usr/bin/pacaur
CP=/usr/bin/cp
REFLECTOR=/usr/bin/reflector

# ---------------------------
#      Snapshot System
# ---------------------------

# -------- OLDSTABLE --------

$BTRFS subvolume delete /.snapshots/OLDSTABLE
$MV /.snapshots/STABLE /.snapshots/OLDSTABLE
$SED -i 's/STABLE/OLDSTABLE/g' /.snapshots/OLDSTABLE/etc/fstab
$CP /boot/vmlinuz-linux-stable /boot/vmlinuz-linux-oldstable
$CP /boot/initramfs-linux-stable.img /boot/initramfs-linux-oldstable.img

# --------- STABLE ----------

$BTRFS subvolume snapshot / /.snapshots/STABLE
$SED -i 's/TESTING/STABLE/g' /.snapshots/STABLE/etc/fstab
$CP /boot/vmlinuz-linux /boot/vmlinuz-linux-stable
$CP /boot/initramfs-linux.img /boot/initramfs-linux-stable.img

# ---------------------------
#      Update System
# ---------------------------

$REFLECTOR --verbose -l 5 -p https --sort rate --save /etc/pacman.d/mirrorlist
$PACMAN -Syu

# ---------------------------
#    Balance Filesystem
# --------------------------

$BTRFS balance start -dusage=5 /btrfs