From 56931c9364d8c6ae8273c83c920a2450f942a255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=95?= <91324887+sasa8810@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:52:56 +0900 Subject: [PATCH 1/3] root check for downr1n --- downr1n.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/downr1n.sh b/downr1n.sh index 59f50cf..b07a8ce 100755 --- a/downr1n.sh +++ b/downr1n.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash +if [ "$(uname)" == "Linux" ]; then + if [ "$EUID" -ne 0 ]; then + echo "You have to run this as root on Linux." + echo "Please type your password" + exec sudo ./downr1n.sh $@ + fi +else + echo "Please don't run as root on macOS. It just breaks permissions." + exit 1 +fi + mkdir -p logs mkdir -p boot mkdir -p ipsw/extracted @@ -1296,4 +1307,4 @@ if [ true ]; then fi -} 2>&1 | tee logs/${log} \ No newline at end of file +} 2>&1 | tee logs/${log} From 23e2c5b2ed97d1749d5dc528a036d30bfb9e9f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=95?= <91324887+sasa8810@users.noreply.github.com> Date: Sun, 31 Dec 2023 07:51:41 +0900 Subject: [PATCH 2/3] Update downr1n.sh --- downr1n.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/downr1n.sh b/downr1n.sh index b07a8ce..4e07bea 100755 --- a/downr1n.sh +++ b/downr1n.sh @@ -7,8 +7,10 @@ if [ "$(uname)" == "Linux" ]; then exec sudo ./downr1n.sh $@ fi else - echo "Please don't run as root on macOS. It just breaks permissions." - exit 1 + if [ "$EUID" -e 0 ]; then + echo "Please don't run as root on macOS. It just breaks permissions." + exit 1 + fi fi mkdir -p logs From 0de8c380596feb2afabcaae959a6adc53f57bacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=95?= <91324887+sasa8810@users.noreply.github.com> Date: Sun, 31 Dec 2023 08:24:40 +0900 Subject: [PATCH 3/3] Update downr1n.sh --- downr1n.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downr1n.sh b/downr1n.sh index 4e07bea..a436469 100755 --- a/downr1n.sh +++ b/downr1n.sh @@ -7,7 +7,7 @@ if [ "$(uname)" == "Linux" ]; then exec sudo ./downr1n.sh $@ fi else - if [ "$EUID" -e 0 ]; then + if [ "$EUID" = "0" ]; then echo "Please don't run as root on macOS. It just breaks permissions." exit 1 fi