mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2024-11-23 16:39:17 +01:00
Detect if running on persistent storage
This commit is contained in:
parent
4ded17bdc7
commit
0961392e48
10
restore.sh
10
restore.sh
@ -164,15 +164,21 @@ set_tool_paths() {
|
|||||||
|
|
||||||
# live cd/usb check
|
# live cd/usb check
|
||||||
if [[ $(id -u $USER) == 999 ]]; then
|
if [[ $(id -u $USER) == 999 ]]; then
|
||||||
|
live_cdusb=1
|
||||||
log "Linux Live CD/USB detected."
|
log "Linux Live CD/USB detected."
|
||||||
if [[ $(pwd) == "/home"* ]]; then
|
if [[ $(pwd) == "/home"* ]]; then
|
||||||
|
if [[ $(lsblk -o label | grep -c "casper-rw") == 1 ]]; then
|
||||||
|
log "Detected iOS-OTA-Downgrader running on persistent storage."
|
||||||
|
else
|
||||||
warn "Detected iOS-OTA-Downgrader running on temporary storage."
|
warn "Detected iOS-OTA-Downgrader running on temporary storage."
|
||||||
print "* You may run out of space and get errors during the downgrade process."
|
print "* You may run out of space and get errors during the downgrade process."
|
||||||
print "* Please move iOS-OTA-Downgrader to an external drive that is NOT used for the live USB."
|
print "* Please move iOS-OTA-Downgrader to an external drive that is NOT used for the live USB."
|
||||||
print "* This means using another external HDD/flash drive to store iOS-OTA-Downgrader on."
|
print "* This means using another external HDD/flash drive to store iOS-OTA-Downgrader on."
|
||||||
|
print "* To be able to use one USB drive only, make sure to enable Persistent Storage for the live USB."
|
||||||
pause
|
pause
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# sudoloop check
|
# sudoloop check
|
||||||
if [[ $(uname -m) == "x86_64" && -e ../resources/sudoloop && $device_sudoloop != 1 ]]; then
|
if [[ $(uname -m) == "x86_64" && -e ../resources/sudoloop && $device_sudoloop != 1 ]]; then
|
||||||
@ -184,8 +190,8 @@ set_tool_paths() {
|
|||||||
device_sudoloop=1
|
device_sudoloop=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ $(uname -m) == "a"* || $device_sudoloop == 1 || $(id -u $USER) == 999 ]]; then
|
if [[ $(uname -m) == "a"* || $device_sudoloop == 1 || $live_cdusb == 1 ]]; then
|
||||||
if [[ $(id -u $USER) != 999 ]]; then
|
if [[ $live_cdusb != 1 ]]; then
|
||||||
print "* Enter your user password when prompted"
|
print "* Enter your user password when prompted"
|
||||||
fi
|
fi
|
||||||
sudo -v
|
sudo -v
|
||||||
|
Loading…
Reference in New Issue
Block a user