Skip to content

Commit 07497fc

Browse files
committed
fix: docker: interactive passphrases went missing long ago
If those PASSPHRASE_XXX variables are not defined, then the Docker won't be able to pass them to container: rooted-ota.sh: line 405: PASSPHRASE_AVB: unbound variable Just ask for them politely in the case they weren't defined.
1 parent d19014a commit 07497fc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

rooted-ota.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,18 @@ function patchOTAs() {
389389
args+=("--patch-arg=--magisk-preinit-device" "--patch-arg" "$MAGISK_PREINIT_DEVICE")
390390
fi
391391

392-
# If env vars not set, passphrases will be queried interactively
393-
if [ -v PASSPHRASE_AVB ]; then
394-
args+=("--pass-avb-env-var" "PASSPHRASE_AVB")
392+
# If env vars not set, passphrases will be queried now!
393+
if [ ! -v PASSPHRASE_AVB ]; then
394+
read -s -p "This is $0, please enter your AVB password! " PASSPHRASE_AVB
395+
echo
395396
fi
397+
args+=("--pass-avb-env-var" "PASSPHRASE_AVB")
396398

397-
if [ -v PASSPHRASE_OTA ]; then
398-
args+=("--pass-ota-env-var" "PASSPHRASE_OTA")
399+
if [ ! -v PASSPHRASE_OTA ]; then
400+
read -s -p "This is $0, please enter your OTA password! " PASSPHRASE_OTA
401+
echo
399402
fi
403+
args+=("--pass-ota-env-var" "PASSPHRASE_OTA")
400404

401405
if [[ "${SKIP_MODULES}" != 'true' ]]; then
402406
args+=("--module-custota" ".tmp/custota.zip")

0 commit comments

Comments
 (0)