GustavoDestroyer

Update.sh

Sep 20th, 2021 (edited)
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Esse script foi possível graças à pessoa rebaixada... (https://github.com/AthenaD3V)
  4.  
  5. RED="\033[38;2;255;0;0m"
  6. GREEN="\033[38;2;0;255;0m"
  7. BLUE="\033[38;2;0;0;255m"
  8. RESET="\033[0m"
  9.  
  10. current=$(curl https://f-droid.org/en/packages/com.termux/ --silent | grep "Version [0-9]*\.[0-9]*" | awk '{print $2}' | tr -d '</b>' | head -c6)
  11. download=$(curl https://f-droid.org/en/packages/com.termux/ --silent | grep -o "https://f-droid.org/repo/com.termux_[0-9]*.apk" -m 1)
  12.  
  13. if [ "$TERMUX_VERSION" = "$current" ]; then
  14.   echo -e "${GREEN}Seu Termux está atualizado!${RESET}"
  15. else
  16.   echo -e "${RED}Seu Termux não está atualizado!${RESET}"
  17.  
  18.   curl "$download" -o "$PREFIX/tmp/termux-updated.apk"
  19.   termux-open "$PREFIX/tmp/termux-updated.apk"
  20. fi
Add Comment
Please, Sign In to add comment