2023-03-23 02:48:20 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-01 19:13:05 +02:00
|
|
|
# Copyright (c) 2021-2024 tteck
|
2023-03-23 02:48:20 +02:00
|
|
|
# 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
|
2024-04-06 15:05:33 +02:00
|
|
|
cat <<EOF >/etc/apt/sources.list.d/non-free.list
|
|
|
|
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
|
|
|
|
EOF
|
|
|
|
$STD apt-get update
|
|
|
|
$STD apt-get install -y unrar
|
|
|
|
rm /etc/apt/sources.list.d/non-free.list
|
2023-03-23 02:48:20 +02:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2023-06-21 16:02:07 +02:00
|
|
|
msg_info "Updating Python3"
|
|
|
|
$STD apt-get install -y \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip
|
2023-03-23 02:48:20 +02:00
|
|
|
$STD apt-get install -y python3-setuptools
|
2024-06-29 17:10:12 +02:00
|
|
|
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
2023-06-21 16:02:07 +02:00
|
|
|
msg_ok "Updated Python3"
|
2023-03-23 02:48:20 +02: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
|
2024-09-06 09:04:44 +02:00
|
|
|
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
2023-03-23 02:48:20 +02:00
|
|
|
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 02:48:20 +02:00
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2024-05-02 19:26:16 +02:00
|
|
|
$STD apt-get -y autoremove
|
|
|
|
$STD apt-get -y autoclean
|
2023-03-23 02:48:20 +02:00
|
|
|
msg_ok "Cleaned"
|