Add --ipsw option (#347)

* Add --ipsw option

No more need to manually edit the script to specify an IPSW URL,
now people can use `--ipsw URL` or `--ipsw=URL` instead.

* Add --ipsw to help
This commit is contained in:
alexia authored and GitHub committed 2023-02-05 09:34:39 -05:00
1 parent c5ec80436d
commit 7e1c40b6cc
1 file changed
+10 -1
+10 -1
View File
@@ -17,7 +17,7 @@ echo "[*] Command ran:`if [ $EUID = 0 ]; then echo " sudo"; fi` ./palera1n.sh $@
# ========= # =========
# Variables # Variables
# ========= # =========
ipsw="" # IF YOU WERE TOLD TO PUT A CUSTOM IPSW URL, PUT IT HERE. YOU CAN FIND THEM ON https://appledb.dev ipsw=""
network_timeout=-1 # seconds; -1 - unlimited network_timeout=-1 # seconds; -1 - unlimited
version="1.4.1" version="1.4.1"
os=$(uname) os=$(uname)
@@ -66,6 +66,7 @@ Options:
--restorerootfs Remove the jailbreak (Actually more than restore rootfs) --restorerootfs Remove the jailbreak (Actually more than restore rootfs)
--debug Debug the script --debug Debug the script
--china Enable Mainland China specific workarounds (启用对中国大陆网络环境的替代办法) --china Enable Mainland China specific workarounds (启用对中国大陆网络环境的替代办法)
--ipsw Specify a custom IPSW to use
--serial Enable serial output on the device (only needed for testing with a serial cable) --serial Enable serial output on the device (only needed for testing with a serial cable)
Subcommands: Subcommands:
@@ -109,6 +110,12 @@ parse_opt() {
--china) --china)
china=1 china=1
;; ;;
--ipsw)
ipsw=$2
;;
--ipsw=*)
ipsw=${1#*=}
;;
--debug) --debug)
debug=1 debug=1
;; ;;
@@ -143,6 +150,8 @@ parse_cmdline() {
parse_opt "$arg"; parse_opt "$arg";
elif [ "$arg_count" -lt "$max_args" ]; then elif [ "$arg_count" -lt "$max_args" ]; then
parse_arg "$arg"; parse_arg "$arg";
elif [[ $arg == http* ]]; then
continue
else else
echo "[-] Too many arguments. Use $0 --help for help."; echo "[-] Too many arguments. Use $0 --help for help.";
exit 1; exit 1;