Last active
December 29, 2021 11:15
-
-
Save shivasiddharth/516795ad20eafa712999b4f39dbe77c6 to your computer and use it in GitHub Desktop.
Script to setup Streama on raspberry Pi
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 | |
sudo apt-get install openjdk-8-jre openjdk-8-jdk -f -y | |
mkdir -p /home/${USER}/streama/data | |
cd /home/${USER}/streama/ | |
wget -c https://gist.githubusercontent.com/shivasiddharth/f657e89c7ad00f441421278291b9ebf8/raw/2f5b2d94ae45b72fac2b0fb32a5bb9be21f0649a/streama_application.yml -O application.yml | |
wget -c https://github.com/streamaserver/streama/releases/download/v1.10.3/streama-1.10.3.jar -O server.jar | |
read -p "Do you wish to set the server to autostart on boot?" yn | |
case $yn in | |
[Yy]*) | |
echo "" | |
echo "" | |
echo "Setting local to auto start on boot...." | |
sudo sed -i '1s/^/# /' /etc/rc.local | |
sudo sed -i '/exit/d' /etc/rc.local | |
sudo sh -c "echo 'cd /home/${USER}/streama/ && sudo java -jar ./server.jar &' >> /etc/rc.local" | |
sudo sh -c "echo 'exit 0' >> /etc/rc.local" | |
sudo systemctl enable rc-local | |
echo "All done... Make sure to add the E-mail credentials in the application.yml file" | |
echo "" | |
;; | |
[Nn]* ) | |
echo "" | |
echo "" | |
echo "You can manually start the assistant using:" | |
echo "" | |
echo "cd /home/${USER}/streama/ && sudo java -jar ./server.jar &" | |
echo "" | |
echo "" | |
echo "All done... Make sure to add the E-mail credentials in the application.yml file" | |
echo "" | |
exit;; | |
* ) echo "Please answer yes or no.";; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment