Created
February 4, 2021 05:33
-
-
Save bryanjhv/d7d376d9cfc9d8c90f5dd11c15d20428 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ARGS: | |
# 1. MODEL (sample: SM-G930F) | |
# 2. REGION (sample: PEO) | |
# 3. OUTDIR (sample: ~/Downloads) | |
# DEPS: | |
# 1. Python 3 | |
# 2. https://github.com/nlscc/samloader | |
[ $# -eq 3 ] || { | |
echo "ERROR: Missing arguments." | |
echo "Run as: $0 MODEL REGION OUTDIR" | |
exit 1 | |
} | |
TMPDIR=$(mktemp -d) | |
cd $TMPDIR | |
SAMLOADER="samloader -m $1 -r $2" | |
$SAMLOADER download -v $($SAMLOADER checkupdate) -D -O . | |
mv *.zip $3 | |
cd .. | |
rm -rf $TMPDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment