Skip to content

Instantly share code, notes, and snippets.

@nperez0111
Last active October 3, 2017 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nperez0111/67d2d32717729070bfd97edbae577848 to your computer and use it in GitHub Desktop.
Save nperez0111/67d2d32717729070bfd97edbae577848 to your computer and use it in GitHub Desktop.
Own Cloud Installer
#!/bin/sh
echo "Thanks for using Nick's OwnCloud Server installer"
#let's just update it all before we start
sudo apt-get update
sudo apt-get upgrade
#start install of owncloud
echo "We are attempting to install OwnCloud"
cd /tmp
#sudo apt-key add - < Release.key
#sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
#sudo apt-get update
sudo apt-get install owncloud mariadb-server
echo "what would you like to be the password for the owncloud database?(you won't ever have to type it in after the one time so choose something strong)"
read databasepass
echo "Enter this line by line like so after you've entered your password:"
echo "CREATE DATABASE owncloud;"
echo "GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY '$databasepass';"
echo "exit"
echo "For immediately below: "
echo "The Password being asked below is the one you set up mysql/mariadb-server with"
sudo mysql -u root -psudo mysql -u root -p
echo "Alright that wasn't too bad let's move on to installing plex"
echo "Go to plex website and give me the download link make sure to get the correct version"
read link
wget "$link"
sudo dpkg -i plexmediaserver*
echo "So Plex is installed let's give it permissions to the folders it needs"
find /var/www/owncloud/data -type d -exec chmod 777 {} \;
find /var/www/owncloud/data -type f -exec chmod 666 {} \;
echo "Plex can now access the files it needs"
echo "Would you like to install Airplay Server?[y/n]"
read val
if [ "$val" = "y" ]; then
apt-get update
sudo apt-get install make -y
sudo apt-get install gcc -y
sudo apt-get install openssl -y
sudo apt-get install pkg-config -y
sudo apt-get install libavahi-client-dev -y
sudo apt-get install libasound2-dev -y
sudo apt-get install libpulse-­dev -y
sudo apt-get install build-essential -y
sudo apt-get install mesa-utils -y
sudo apt-get install libao-common -y
sudo apt-get install libcrypt-openssl-rsa-perl -y
sudo apt-get install libao-dev -y
sudo apt-get install libio-socket-inet6-perl -y
sudo apt-get install libwww-perl avahi-utils -y
sudo apt-get install libshairport1 -y
sudo apt-get install libshairport-dev -y
sudo apt-get install libasound2-doc -y
sudo apt-get install libglib2.0-doc -y
sudo apt-get install libssl-dev -y
sudo apt-get install unzip -y
apt-get update
cd /usr/local
mkdir shairport
cd shairport
sudo wget https://github.com/abrasive/shairport/archive/master.zip
sudo unzip master.zip
sudo rm master.zip
cd shairport-master
./configure
sudo make
sudo make install
cd /etc/init.d
touch shairport.sh
echo "#!/bin/bash
cd /usr/local/shairport/shairport-master
./shairport -a 'Airplay' -d
read
" >> shairport.sh
chmod +x shairport.sh
#bash shairport.sh
echo "Shairport should now start when the server starts...";
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment