Files
public-data/seedbox-install.sh
T

54 lines
1.2 KiB
Bash

echo "deb [trusted=yes] https://flood-apt-repo.pages.dev/ devel main" | sudo tee /etc/apt/sources.list.d/flood.list
sudo apt update
sudo apt install -y flood
sudo apt install -y rtorrent
SERVICE_USER="download"
FLOOD_PORT="8098"
FLOOD_HOST="0.0.0.0"
sudo useradd --create-home --shell /bin/false "$SERVICE_USER"
sudo tee /etc/systemd/system/flood@.service > /dev/null <<EOF
[Unit]
Description=Flood service for %I
After=network.target
[Service]
User=%I
Group=%I
Type=simple
KillMode=process
ExecStart=/usr/bin/env flood --host=${FLOOD_HOST} --port=${FLOOD_PORT}
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
sudo tee /etc/systemd/system/rtorrent@.service > /dev/null <<EOF
[Unit]
Description=rTorrent service for %I
After=network.target
[Service]
User=%I
Group=%I
Type=simple
KillMode=process
ExecStart=/usr/bin/env rtorrent
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable flood@${SERVICE_USER}.service
sudo systemctl enable flood@${SERVICE_USER}.service
sudo systemctl restart rtorrent@${SERVICE_USER}.service
sudo systemctl restart rtorrent@${SERVICE_USER}.service
echo "Flood run in:"
echo "http://<SERVER_IP>:${FLOOD_PORT}"