07.install_chromedriver.sh 634 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. $su apt-get update -qq
  11. $su apt-get install -qq -y curl
  12. mkdir -p ~/bin
  13. mkdir -p ~/Downloads
  14. cd ~/Downloads || return
  15. filename=chromedriver-linux64.zip
  16. latest_release=$(curl -L "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE")
  17. latest_release_url="https://storage.googleapis.com/chrome-for-testing-public/${latest_release}/linux64/${filename}"
  18. curl -OL "${latest_release_url}"
  19. unzip -u ${filename}
  20. mv chromedriver-linux64/chromedriver $HOME/bin/