Procházet zdrojové kódy

Ahora no hay bifurcación por sistema operativo

Hugo před 6 roky
rodič
revize
f458a68436
1 změnil soubory, kde provedl 33 přidání a 79 odebrání
  1. 33 79
      fourier_install.sh

+ 33 - 79
fourier_install.sh

@@ -19,10 +19,6 @@ mount_point=/media/datadrive
 echo "Fourier installer $installer_version"
 echo "------------------------------------"
 
-if [[ "$OSTYPE" == darwin* ]]; then
-	programspath=~/fourier
-fi
-
 clonerepo() {
 	GIT_SSH_COMMAND="ssh -i $installerpath/repokey -o StrictHostKeychecking=no" \
 					git clone $gitbase/$1 $2
@@ -42,15 +38,10 @@ if [ "$?" -neq 0 ]; then
 	echo -e 'Data drive is not mounted'
 fi
 
-if [[ "$OSTYPE" == darwin* ]]; then
-	keyfile="$programspath/fourier.key"
-	[ ! -f "$keyfile" ] && ssh-keygen -t rsa -b 2048 -f $keyfile
-else
-	keyspath=~/.ssh
-	keyfile="$keyspath/id_rsa"
-	[ ! -d "$keyspath" ] && mkdir $keyspath
-	ssh-keygen -t rsa -b 2048 -C "$HOSTNAME" -P "" -f $keyfile
-fi
+keyspath=~/.ssh
+keyfile="$keyspath/id_rsa"
+[ ! -d "$keyspath" ] && mkdir $keyspath
+ssh-keygen -t rsa -b 2048 -C "$HOSTNAME" -P "" -f $keyfile
 
 keycontent=$(cat $keyfile.pub)
 curl -X POST -F "key=$keycontent" \
@@ -61,49 +52,35 @@ curl -X POST -F "key=$keycontent" \
 # So it can use the devices in /dev/dvb/adapter*
 sudo usermod -a -G video fourier
 
-if [[ "$OSTYPE" == darwin* ]]; then
-	depend=( python gcc vim tmux autossh lame nodejs \
-			 ezstream libusb rtl-sdr portaudio )
-	for dep in "${depend[@]}"
-	do
-		brew list $dep > /dev/null
-		[ "$?" -eq 1 ] && brew install $dep
-	done
-	envpath="$programspath/env"
-	[ ! -d "$envpath" ] && virtualenv $programspath/env
-	source $envpath/bin/activate
-	pip install -r $installerpath/requirements.txt
-else
-	curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
-	sudo apt-get install -y alsa-utils alsa-tools
-	sudo apt-get install -y libudev-dev
-	sudo apt-get install -y tmux
-	sudo apt-get install -y vim
-	sudo apt-get install -y autossh
-	sudo apt-get install -y git-core
-	sudo apt-get install -y build-essential
-	sudo apt-get install -y nodejs
-	sudo apt-get install -y python-dev
-	sudo apt-get install -y lame
-	sudo apt-get install -y ezstream
-	sudo apt-get install -y cmake
-	sudo apt-get install -y rtl-sdr
-	sudo apt-get install -y sqlite3
-	sudo apt-get install -y portaudio19-dev
-	sudo apt-get install -y dvb-apps
-	sudo pip install pyaudio pyusb pydub numpy requests \
-					 scipy python-firebase tornado mutagen \
-					 pyopenssl
-	sudo apt-get install -y ffmpeg
-	sudo apt-get install -y gfortran libopenblas-dev liblapack-dev
-	sudo apt-get install -y python-matplotlib
-	sudo apt-get install -y curl
-	sudo apt-get install -y libshout3 libshout3-dev
-	sudo npm install -g http-server
-	cd tools
-	sudo python ./setup.py install
-	cd ..
-fi
+curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
+sudo apt-get install -y alsa-utils alsa-tools
+sudo apt-get install -y libudev-dev
+sudo apt-get install -y tmux
+sudo apt-get install -y vim
+sudo apt-get install -y autossh
+sudo apt-get install -y git-core
+sudo apt-get install -y build-essential
+sudo apt-get install -y nodejs
+sudo apt-get install -y python-dev
+sudo apt-get install -y lame
+sudo apt-get install -y ezstream
+sudo apt-get install -y cmake
+sudo apt-get install -y rtl-sdr
+sudo apt-get install -y sqlite3
+sudo apt-get install -y portaudio19-dev
+sudo apt-get install -y dvb-apps
+sudo pip install pyaudio pyusb pydub numpy requests \
+				 scipy python-firebase tornado mutagen \
+				 pyopenssl
+sudo apt-get install -y ffmpeg
+sudo apt-get install -y gfortran libopenblas-dev liblapack-dev
+sudo apt-get install -y python-matplotlib
+sudo apt-get install -y curl
+sudo apt-get install -y libshout3 libshout3-dev
+sudo npm install -g http-server
+cd tools
+sudo python ./setup.py install
+cd ..
 
 sudo chmod 0600 $installerpath/repokey
 
@@ -131,20 +108,6 @@ sudo python setup.py install
 
 sudo npm install -g pm2
 
-# build sdr lib
-if [[ "$OSTYPE" != darwin* ]]; then
-	sudo apt-get install -y libusb-1.0-0-dev
-	cd $programspath
-	clonerepo rtl-sdr.git rtl-sdr
-	cd $programspath/rtl-sdr
-	mkdir build
-	cd build
-	cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
-	make
-	sudo cp ./src/rtl_fm /usr/bin/rtl_fm
-	echo "SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666"" | sudo tee -a /etc/udev/rules.d/rtl-sdr.rules
-fi
-
 [ ! -f "$configfile" ] && \
 	sudo python $installerpath/configure.py \
 		   		$installerpath/fourier-config.json \
@@ -186,12 +149,3 @@ if [ ! -f "/etc/systemd/system/ssh-tunnel.service" ]; then
 	sudo systemctl enable ssh-tunnel
 	sudo systemctl start ssh-tunnel
 fi
-	
-if [[ "$OSTYPE" != darwin* ]]; then
-	sudo mysql -u root -e "create database $mysql_db;"
-	sudo mysql -u root -e "create user '$mysql_user'@'localhost' identified by '$mysql_passwd';"
-	sudo mysql -u root -e "grant all privileges on $mysql_db.* to '$mysql_user'@'localhost';flush privileges;"
-	cd ~
-	sudo mysql -u root -h localhost $mysql_db < $installerpath/fourier.sql
-	sudo cp $installerpath/fourier-key.json /etc/Fourier-key.json
-fi