From e4940ab3b59f3fc5a7a2ee015b489897b03eb06a Mon Sep 17 00:00:00 2001 From: Mineek Date: Sat, 24 Sep 2022 15:08:06 +0200 Subject: [PATCH] allow url's to ipsw's to be specified --- palera1n.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/palera1n.sh b/palera1n.sh index e172842..bb48579 100755 --- a/palera1n.sh +++ b/palera1n.sh @@ -139,7 +139,12 @@ echo "[*] Getting device info..." cpid=$("$dir"/irecovery -q | grep CPID | sed 's/CPID: //') model=$("$dir"/irecovery -q | grep MODEL | sed 's/MODEL: //') deviceid=$("$dir"/irecovery -q | grep PRODUCT | sed 's/PRODUCT: //') -ipswurl=$(curl -sL "https://api.ipsw.me/v4/device/$deviceid?type=ipsw" | "$dir"/jq '.firmwares | .[] | select(.version=="'"$version"'") | .url' --raw-output) +# if the version variable is an url, use that instead +if [[ "$version" == http* ]]; then + ipswurl=$version +else + ipswurl=$(curl -sL "https://api.ipsw.me/v4/device/$deviceid?type=ipsw" | "$dir"/jq '.firmwares | .[] | select(.version=="'"$version"'") | .url' --raw-output) +fi # Have the user put the device into DFU if [ ! "$2" = '--dfu' ]; then