SAMPLE-rollback 1006 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. APP=SAMPLE
  3. rm -f ./rollback-args ./AM-rollback
  4. URL=WEBPAGE-CONTAINING-URLS
  5. SITE=MAIN-DOMAIN-OR-SITE
  6. printf "%s\n" $(wget -q $URL -O - | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -i appimage) >> "./rollback-args" &&
  7. echo -e "-----------------------------------------------------------------------\nYou have chosen to roll back $APP.\nRollback will be done from $SITE\n-----------------------------------------------------------------------"
  8. printf "Select a URL from this menu (read carefully) or press CTRL+C to abort:\n-----------------------------------------------------------------------\n"; sleep 1;
  9. select d in $(cat "./rollback-args"); do test -n "$d" && break; echo ">>> Invalid Selection"; done
  10. cp ./AM-updater ./AM-rollback
  11. sed -i 's/version0/#version0/g' ./AM-rollback
  12. sed -i '/show-progress/c\wget -q --show-progress '$d'' ./AM-rollback
  13. ./AM-rollback
  14. rm -f ./version
  15. echo $d >> ./version
  16. rm -f ./rollback-args ./AM-rollback
  17. echo -e "\nROLLBACK SUCCESSFUL!"
  18. exit