forked from Trevo525/btrfdeck
-
Notifications
You must be signed in to change notification settings - Fork 1
/
btrfdeck_post_update.sh
executable file
·27 lines (24 loc) · 1.04 KB
/
btrfdeck_post_update.sh
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
#!/bin/bash
# TODO - compare current files against old backup in case Valve made changes
# - requires password to be set, perhaps edit readme to include that
# - better logic
set -e
cd /home/deck/btrfdeck || echo "Could not find btrfdeck repo!"
echo "Backing up current files..."
cp /usr/lib/hwsupport/sdcard-mount.sh ./backup/sdcard-mount.sh
#cp /usr/lib/hwsupport/format-sdcard.sh ./backup/format-sdcard.sh
echo "Temporarily disabling readonly filesystem..."
sudo steamos-readonly disable
echo "Removing current files..."
sudo rm /usr/lib/hwsupport/sdcard-mount.sh
#sudo rm /usr/lib/hwsupport/format-sdcard.sh
echo "Copying modified files..."
sudo cp ./modified/sdcard-mount.sh /usr/lib/hwsupport/sdcard-mount.sh
#sudo cp ./modified/format-sdcard.sh /usr/lib/hwsupport/format-sdcard.sh
echo "Editing new file permissions..."
sudo chmod 755 /usr/lib/hwsupport/sdcard-mount.sh /usr/lib/hwsupport/format-sdcard.sh
echo "Re-enabling readonly filesystem..."
sudo steamos-readonly enable
echo "Done!"
read -n1 -sr -p "Press any key to exit..."
exit