Created
December 15, 2022 12:29
-
-
Save YHNdnzj/d72be92c71e1a775adfcdd23556999d3 to your computer and use it in GitHub Desktop.
This file contains 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 -e | |
set -o pipefail | |
product="$1" | |
( | |
set -x | |
[[ -n $product ]] | |
fastboot getvar product |& grep -q "$product" | |
) | |
echo | |
cd "$product" | |
mv flash_all.sh flash_all.sh.bak | |
tee flash_all.sh <<< "#!/bin/bash -ex" | |
grep "^fastboot" flash_all.sh.bak | grep -v 'getvar\|reboot' | sed -e 's/`dirname $0`\///g' -e 's#$\* ##g' | tee -a flash_all.sh | |
echo | |
read -rp "Continue? [y/N] " | |
if [[ ${REPLY,,} =~ ^(y|yes)$ ]]; then | |
chmod +x flash_all.sh | |
exec ./flash_all.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment