Skip to content

Instantly share code, notes, and snippets.

@BOT-K4CP3R
Last active June 25, 2024 12:19
Show Gist options
  • Save BOT-K4CP3R/eef8d98508117abbdc23100045660dc2 to your computer and use it in GitHub Desktop.
Save BOT-K4CP3R/eef8d98508117abbdc23100045660dc2 to your computer and use it in GitHub Desktop.
StreamBox Client 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
apt-get install -y bind9
echo '
zone "streambox.local" {
type master;
file "/etc/bind/db.streambox.local";
};
' > /etc/bind/named.conf.local
echo '
$TTL 604800
@ IN SOA streambox.local. root.streambox.local. (
2 ;
604800 ;
86400 ;
2419200 ;
604800 ) ;
;
@ IN NS streambox.local.
@ IN A 127.0.0.1
' > /etc/bind/db.streambox.local
systemctl restart bind9
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 $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