Advertisement
MertcanGokgoz

Spotify İnstall

Dec 30th, 2018
10,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.14 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. #Check root
  4. if [ $(id -u) != "0" ];
  5. then
  6.     echo "Needs to be run by a user with root privilege."
  7.     exit 1
  8. fi
  9.  
  10. # Check debian packages manager
  11. if [ -n "$(command -v apt-get | wc -l)" != "1" ]
  12. then
  13.     echo "Please use Debian based system"
  14.     exit 1
  15. fi
  16.  
  17. # Check to see if Spotify repository
  18. echo "  Checking /etc/apt/sources.list for repository."
  19. ssource=`grep -o -E "deb http://repository.spotify.com stable non-free" /etc/apt/sources.list | wc -l`
  20. if [ $ssource -eq 0 ]; then
  21.     echo '' | sudo tee -a /etc/apt/sources.list.d/spotify.list
  22.     echo '## SPOTIFY-CLIENT' | sudo tee -a /etc/apt/sources.list.d/spotify.list
  23.     echo 'deb http://repository.spotify.com stable non-free' | sudo tee -a /etc/apt/sources.list.d/spotify.list
  24. else
  25.     echo "  Skipping addition to /etc/apt/sources.list.d/sources.list."
  26. fi
  27.  
  28. # Verify downloaded packages
  29. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886
  30.  
  31. # Run apt-get update
  32. sudo apt-get update
  33.  
  34. # Install spotify!
  35. sudo apt-get install spotify-client
  36.  
  37. echo "  Done. Add Spotify to your system"
  38. echo "  Press any key to continue."
  39. read
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement