Created
July 26, 2020 07:06
-
-
Save mertcangokgoz/2269fe45cc0dc724ead1e25a7c756b0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
#Check root | |
if [ $(id -u) != "0" ]; | |
then | |
echo "Needs to be run by a user with root privilege." | |
exit 1 | |
fi | |
# Check debian packages manager | |
if [ -n "$(command -v apt-get | wc -l)" != "1" ] | |
then | |
echo "Please use Debian based system" | |
exit 1 | |
fi | |
# Check to see if Spotify repository | |
echo " Checking /etc/apt/sources.list for repository." | |
ssource=`grep -o -E "deb https://www.spotify.com/tr/download/linux/ stable non-free" /etc/apt/sources.list | wc -l` | |
if [ $ssource -eq 0 ]; then | |
echo '' | sudo tee -a /etc/apt/sources.list.d/spotify.list | |
echo '## SPOTIFY-CLIENT' | sudo tee -a /etc/apt/sources.list.d/spotify.list | |
echo 'deb https://www.spotify.com/tr/download/linux/ stable non-free' | sudo tee -a /etc/apt/sources.list.d/spotify.list | |
else | |
echo " Skipping addition to /etc/apt/sources.list.d/sources.list." | |
fi | |
# Verify downloaded packages | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 | |
# Run apt-get update | |
sudo apt-get update | |
# Install spotify! | |
sudo apt-get install spotify-client | |
echo " Done. Add Spotify to your system" | |
echo " Press any key to continue." | |
read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment