Skip to content

Instantly share code, notes, and snippets.

@BOT-K4CP3R
Last active June 25, 2024 12:20
Show Gist options
  • Save BOT-K4CP3R/09052635dfe569c417f3a6c46dfc4a37 to your computer and use it in GitHub Desktop.
Save BOT-K4CP3R/09052635dfe569c417f3a6c46dfc4a37 to your computer and use it in GitHub Desktop.
StreamBox Server Installation script
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "You must be root!"
exit 1
fi
sudo apt-get update
sudo apt-get install -y curl git
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
APP_DIR="/streambox"
sudo mkdir -p $APP_DIR
sudo git clone https://github.com/BOT-K4CP3R/streambox-server $APP_DIR
cd $APP_DIR
sudo npm install
sudo tee /etc/systemd/system/streambox.service > /dev/null <<EOF
[Unit]
Description=Streambox
After=network.target
[Service]
User=root
WorkingDirectory=$APP_DIR
ExecStart=/usr/bin/node index.js
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=streambox
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable streambox.service
sudo systemctl start streambox.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment