From 9dff87040abf165d221ba275425504185aa2770b Mon Sep 17 00:00:00 2001 From: gabriel becker Date: Wed, 9 Nov 2022 15:03:24 +1100 Subject: [PATCH] make ADB_DEVICE environment variable optional --- README.md | 4 +++- reinstall-magisk-on-lineageos | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 090a0f0..bb3fb15 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ Steps: 1. Build
```docker build -t magiskupdate .``` 2. Run
- ```docker run --env ADB_DEVICE= magiskupdate``` + ```docker run --env ADB_DEVICE= magiskupdate``` \ + or, if you're lazy do: + ```docker run magiskupdate``` ## Bash diff --git a/reinstall-magisk-on-lineageos b/reinstall-magisk-on-lineageos index 863a052..dc6f563 100755 --- a/reinstall-magisk-on-lineageos +++ b/reinstall-magisk-on-lineageos @@ -3,6 +3,9 @@ set -e PHONE_ADB_SERIAL_NUMBER=${ADB_DEVICE} # The adb serial number can be found by running `adb devices`. +if [$PHONE_ADB_SERIAL_NUMBER = '']; then + PHONE_ADB_SERIAL_NUMBER=$(echo $(adb devices) | sed -rn 's/(^|(.* ))([^ ]*) device(( .*)|$)/\3/; T; p; q') +fi print_message() { printf "$1\n"