forked from lanceseidman/PiCAST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.sh
124 lines (113 loc) · 3.92 KB
/
installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/sh
# INSTALLER/SCRIPT CANNOT BE EDITED NOR DUPLICATED FOR ANY PROJECT.
# COLOR RED (Use if Root User)
clrRED="\033[0;31m"
# CLEAR COLOR
clrCLEAN="\033[0m"
# REQUIRED
reqApps="apache2 apache2 apache2-utils libapache2-mod-php5 php5 php-pear php5-xcache php5-mysql mysql-server mysql-client mplayer mplayer-gui youtube-dl git-core"
# START CHECK OF ROOT LOGIN (NO COMPLETED)
if [ $(whoami) = "root" ]
then
echo $clrRED"Sorry, please run as Pi or non-root account!"$clrCLEAN
exit 1
else
# NON-ROOT LOGIN; PROCEED SETUP
clear # Let's clear the Window!
echo "############################################"
echo "# WELCOME TO PICAST AUTO-SETUP! #"
echo "# by Lance Seidman #"
echo "#------------------------------------------#"
echo "# I'm here to perform some tasks, so try #"
echo "# to hold on a few moments... I'll let you #"
echo "# know what's going on as I do them... #"
echo "#------------------------------------------#"
echo "# Without further ado, let's get started! #"
echo "# Hang tight... Or LOOSE! #"
echo "############################################"
echo ""
echo " I'm going to start now...."
echo ""
echo "Cleaning old APT Cache..."
sudo aptitude clean
echo "Removing old Configs..."
sudo aptitude purge $OLDCONF
# START APP INSTALL
echo "Go Play! Go Watch TV/YouTube, just don't touch!"
sleep 2
echo "PiCAST is installing everything you need..."
echo "-----------------------------------------------"
sleep 5
echo "!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!"
echo "When asked for MySQL Password, use: thePICAST. "
sleep 10
sudo aptitude install -y $reqApps
# UPDATE YOUTUBE-DL (Use for YouTube Audio Downloading)
clear
echo "We need to run an update for getting the latest"
echo "method to get YouTube Stream/Downloading... "
sleep 3
echo "Follow any prompts that may display.... "
sudo youtube-dl -U
# SETUP MYSQL
clear
echo "We need to setup MySQL, I will help you..."
echo "------------------------------------------"
sleep 2
echo "Type MySQL Password if asked (thePICAST). "
sleep 2
# MAKE DATABASE
sudo mysql -uroot -pthePICAST "CREATE DATABASE picaster;"
sleep 2
echo "Database Created!"
sudo mysql -uroot -pthePICAST "CREATE USER 'picast'@'localhost' IDENTIFIED BY 'piCAST1337';"
echo "User Created!"
sleep 2
sudo mysql -uroot -pthePICAST "GRANT ALL PRIVILEGES ON picast . Items TO 'picast'@'localhost';"
sleep 2
sudo mysql -uroot -pthePICAST "FLUSH PRIVLEGES;"
echo "MySQL setup is Complete!"
sleep 2
# COPY EVERYTHING FOR PICAST
clear # clear the screen
echo "Congratulations! We got everything & Setup is almost Done!"
echo ""
sleep 2
echo "I'm going to download missing parts now..."
echo ""
sleep 2
# WE'LL USE GITHUB TO PROPERLY GRAB LATEST MASTER FILES
git clone https://github.com/lanceseidman/PiCAST.git
sudo mv PiCAST /var/www/ # Let's move it!
sudo rm -rf /var/www/PiCAST/installer.sh # Don't want/need this anymore!
sudo mv /var/www/PiCAST/grabber.sh /home/$USER/picast/grabber.sh
sudo chmod +x /home/$USER/picast/grabber.sh
#sudo rm -rf /var/www/PiCAST/netflix # Remove till this works!
#sudo rm -rf /var/www/PiCAST/music_grooveshark # Remove till this works!
#sudo rename README.md README.txt # Rename for less EU confusion
echo "Done..."
sleep 2
clear
echo "Going to Download GrooveShark Downloader..."
sleep 2
git clone https://github.com/jacktheripper51/groove-dl.git
sudo mv groove-dl /home/$USER/picast
echo "GrooveShark Downloader Complete..."
pause 2
echo "You can now run PiCAST from the folder picast in your user folder!"
sleep 3
echo "To run the service, simply type: "
echo "watch -n xx sh grabber.sh (replace xx with amount of seconds)."
sleep 3
# ASK IF synergy IS DESIRED
echo "Would you like to install synergy to use your Mouse/Keyboard?"
echo "Type 'y' if you'd like it or to cancel press any key..."
read RESP
if [ "$RESP" = "y" ]; then
sudo apt-get install synergy -y
else
echo "Synergy WON'T be installed..."
fi
sleep 2
echo "Good luck! You're done!"
fi