install-freetube.sh 421 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. require_sudo() {
  4. if [[ $EUID -ne 0 ]]; then
  5. echo "Please run as superuser! Try running:"
  6. echo "sudo $0"
  7. exit 2
  8. fi
  9. }
  10. require_sudo
  11. url="https://freetubeapp.io/#download"
  12. download_link=$(curl "$url" | \grep -E 'amd64.*\.deb' | cut -d\" -f2)
  13. filename="/tmp/freetube.deb"
  14. wget -c "$download_link" -O "$filename"
  15. dpkg -i "$filename"