mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-23 19:59:17 +01:00
Request root access only when all files are present in offline mode
This commit is contained in:
parent
9968805324
commit
42f56d9af4
@ -275,6 +275,12 @@ if [ "$DEBUG" ]; then
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
require_su() {
|
||||||
|
if [ "$(sudo whoami)" != "root" ]; then
|
||||||
|
sudo echo "sudo is required to run this script"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast")
|
declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast")
|
||||||
RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort
|
RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort
|
||||||
|
|
||||||
@ -295,11 +301,10 @@ if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
|
|||||||
else
|
else
|
||||||
GAPPS_PATH="$DOWNLOAD_DIR"/MindTheGapps-"$ARCH".zip
|
GAPPS_PATH="$DOWNLOAD_DIR"/MindTheGapps-"$ARCH".zip
|
||||||
fi
|
fi
|
||||||
if [ "$(sudo whoami)" != "root" ]; then
|
|
||||||
sudo echo "sudo is required to run this script"
|
|
||||||
fi
|
|
||||||
if [ -z "${OFFLINE+x}" ]; then
|
if [ -z "${OFFLINE+x}" ]; then
|
||||||
trap 'rm -f -- "${DOWNLOAD_DIR:?}/${DOWNLOAD_CONF_NAME}"' EXIT
|
trap 'rm -f -- "${DOWNLOAD_DIR:?}/${DOWNLOAD_CONF_NAME}"' EXIT
|
||||||
|
require_su
|
||||||
echo "Generate Download Links"
|
echo "Generate Download Links"
|
||||||
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
|
||||||
if [ -z "${CUSTOM_MAGISK+x}" ]; then
|
if [ -z "${CUSTOM_MAGISK+x}" ]; then
|
||||||
@ -332,6 +337,7 @@ else
|
|||||||
echo "Offline mode: Some files are missing, please disable offline mode."
|
echo "Offline mode: Some files are missing, please disable offline mode."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
require_su
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Extract WSA"
|
echo "Extract WSA"
|
||||||
|
Loading…
Reference in New Issue
Block a user