2023-03-23 01:48:20 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Copyright (c) 2021-2023 tteck
|
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
|
|
|
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
|
|
|
$STD apt-get install -y curl
|
|
|
|
$STD apt-get install -y sudo
|
|
|
|
$STD apt-get install -y mc
|
|
|
|
$STD apt-get install -y par2
|
|
|
|
$STD apt-get install -y p7zip-full
|
2023-11-25 16:19:33 +01:00
|
|
|
RELEASE=$(curl -s http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/ | grep -oP 'href="\K[^"]*unrar_7\.\d+\.\d+-\d+_amd64\.deb' | head -1)
|
2023-11-14 00:20:59 +01:00
|
|
|
wget -q http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/$RELEASE
|
2023-11-13 23:42:37 +01:00
|
|
|
$STD dpkg -i unrar*.deb
|
|
|
|
rm unrar*.deb
|
2023-03-23 01:48:20 +01:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2023-06-21 16:02:07 +02:00
|
|
|
msg_info "Updating Python3"
|
|
|
|
$STD apt-get install -y \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip
|
2023-03-23 01:48:20 +01:00
|
|
|
$STD apt-get install -y python3-setuptools
|
2023-06-21 16:02:07 +02:00
|
|
|
msg_ok "Updated Python3"
|
2023-03-23 01:48:20 +01:00
|
|
|
|
|
|
|
msg_info "Installing SABnzbd"
|
|
|
|
RELEASE=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
|
|
$STD tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
|
|
|
|
mv SABnzbd-${RELEASE} /opt/sabnzbd
|
|
|
|
cd /opt/sabnzbd
|
|
|
|
$STD python3 -m pip install -r requirements.txt
|
|
|
|
msg_ok "Installed SABnzbd"
|
|
|
|
|
|
|
|
msg_info "Creating Service"
|
|
|
|
service_path="/etc/systemd/system/sabnzbd.service"
|
|
|
|
echo "[Unit]
|
|
|
|
Description=SABnzbd
|
|
|
|
After=network.target
|
|
|
|
[Service]
|
|
|
|
WorkingDirectory=/opt/sabnzbd
|
|
|
|
ExecStart=python3 SABnzbd.py -s 0.0.0.0:7777
|
|
|
|
Restart=always
|
|
|
|
User=root
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target" >$service_path
|
|
|
|
systemctl enable --now -q sabnzbd.service
|
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 13:39:30 +02:00
|
|
|
customize
|
2023-03-23 01:48:20 +01:00
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
|
|
|
$STD apt-get autoremove
|
|
|
|
$STD apt-get autoclean
|
|
|
|
msg_ok "Cleaned"
|