From 76547593aea595c9d9d730c829001f13fa8d0552 Mon Sep 17 00:00:00 2001 From: mrhoomanwastaken <113311405+mrhoomanwastaken@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:35:09 -0600 Subject: [PATCH] Update pkgrecover.sh Will now check to make sure the important directories are mounted. --- pkgrecover.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgrecover.sh b/pkgrecover.sh index 8fdb0d3..e63e4b3 100644 --- a/pkgrecover.sh +++ b/pkgrecover.sh @@ -3,7 +3,24 @@ VERSION="1.0.0" USE_PACMAN_STATIC=${USE_PACMAN_STATIC:-"false"} +directory_check() { + RED='\033[0;31m' + #checks to make sure that all the important directories are mounted properly + if [[ ! -d /proc]]; then + echo -e "${RED} ERROR: /proc is not mounted. upgrading without /proc mounted can cause damage." + exit 1 + fi + + if [[ ! -d /sys]]; then + echo -e "${RED} ERROR: /sys is not mounted. upgrading without /sys mounted can cause damage." + exit 1 + fi + if [[ ! -d /boot]]; then + echo -e "${RED} ERROR: /boot is not mounted. upgrading without /boot mounted can cause damage." + exit 1 + fi +} install_pacman_static() { if [[ ! -f /tmp/pacman-static.installed ]]; then echo "Downloading and installing pacman-static. In case that curl fails, you can download the binary from:"