This commit is contained in:
Slaviša Arežina
2026-03-08 13:25:24 +01:00
committed by GitHub
parent 447fe2c2e3
commit 8be52ab1ad
3 changed files with 33 additions and 2 deletions

View File

@@ -27,6 +27,16 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
if ! command -v unrar &>/dev/null; then
setup_nonfree
$STD apt install -y unrar
if grep -q "UnrarCmd=unrar-free" /var/lib/nzbget/nzbget.conf; then
sed -i "s|UnrarCmd=unrar-free|UnrarCmd=unrar|g" /var/lib/nzbget/nzbget.conf
fi
fi
msg_info "Updating NZBGet"
$STD apt update
$STD apt upgrade -y

View File

@@ -14,10 +14,12 @@ setting_up_container
network_check
update_os
setup_nonfree
msg_info "Installing Dependencies"
$STD apt install -y \
par2 \
unrar-free
unrar
msg_ok "Installed Dependencies"
msg_info "Installing NZBGet"
@@ -27,7 +29,6 @@ setup_deb822_repo \
"https://nzbgetcom.github.io/deb" \
"stable"
$STD apt install -y nzbget
sed -i "s|UnrarCmd=unrar|UnrarCmd=unrar-free|g" /var/lib/nzbget/nzbget.conf
sed -i "s|SevenZipCmd=7zz|SevenZipCmd=7z|g" /var/lib/nzbget/nzbget.conf
systemctl restart nzbget
msg_ok "Installed NZBGet"

View File

@@ -8192,3 +8192,23 @@ function fetch_and_deploy_from_url() {
msg_ok "Successfully deployed archive to $directory"
return 0
}
setup_nonfree() {
local sources_file="/etc/apt/sources.list.d/debian-nonfree.sources"
if [ ! -f "$sources_file" ]; then
cat <<EOF >$sources_file
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free non-free-firmware
Types: deb
URIs: http://security.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
EOF
fi
$STD apt update
return 0
}