manager.sh aktualisiert
Signed-off-by: hax <hax@lainlounge.xyz>
This commit is contained in:
parent
ccf2d2ac72
commit
8b04312ee6
1 changed files with 58 additions and 7 deletions
65
manager.sh
65
manager.sh
|
|
@ -2,7 +2,7 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Path to the variables log file
|
# Path to the variables log file
|
||||||
VARIABLES_LOG="/rescue/variables.log"
|
VARIABLES_LOG="/root/variables.log"
|
||||||
|
|
||||||
# Auto-elevate script if not running as root
|
# Auto-elevate script if not running as root
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
|
@ -62,12 +62,63 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure necessary mount points are available before mounting
|
# Ensure necessary mount points are available before mounting
|
||||||
mkdir -p /rescue/boot
|
if [ -d /rescue/boot ]; then
|
||||||
mkdir -p /rescue/home
|
echo "/rescue/boot exists already, continuing..."
|
||||||
mkdir -p /rescue/proc
|
else
|
||||||
mkdir -p /rescue/sys
|
echo "Creating /rescue/boot directory..."
|
||||||
mkdir -p /rescue/dev/pts
|
mkdir -p /rescue/boot
|
||||||
mkdir -p /rescue/run
|
fi
|
||||||
|
|
||||||
|
if [ -d /rescue/home ]; then
|
||||||
|
echo "/rescue exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue/home directory..."
|
||||||
|
mkdir -p /rescue/home
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /rescue ]; then
|
||||||
|
echo "/rescue exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue directory..."
|
||||||
|
mkdir -p /rescue
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------- #
|
||||||
|
|
||||||
|
if [ -d /rescue/proc ]; then
|
||||||
|
echo "/rescue/proc exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue/proc directory..."
|
||||||
|
mkdir -p /rescue/proc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /rescue/sys ]; then
|
||||||
|
echo "/rescue/sys exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue directory..."
|
||||||
|
mkdir -p /rescue/sys
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /rescue/dev/pts ]; then
|
||||||
|
echo "/rescue/dev/pts exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue/dev/pts directory..."
|
||||||
|
mkdir -p /rescue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /rescue/run ]; then
|
||||||
|
echo "/rescue exists already, continuing..."
|
||||||
|
else
|
||||||
|
echo "Creating /rescue/run directory..."
|
||||||
|
mkdir -p /rescue/run
|
||||||
|
fi
|
||||||
|
# ----------------------------------------------------- #
|
||||||
|
|
||||||
|
if [ -d /rescue/boot ] && [ -d /rescue/home ] && [ -d /rescue/proc ] && [ -d /rescue/sys ] && [ -d /rescue/dev/pts ] && [ -d /rescue/run ]; then
|
||||||
|
echo "All required directories exist. Proceeding with mounting procedure..."
|
||||||
|
else
|
||||||
|
echo "One or more required directories are missing. Please create them before chrooting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Mount the partitions
|
# Mount the partitions
|
||||||
echo "Mounting OS partition..."
|
echo "Mounting OS partition..."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue