This commit is contained in:
CanbiZ 2025-04-29 14:40:39 +02:00
parent 5ffce7470f
commit 1501c3a514
3 changed files with 3 additions and 159 deletions

View File

@ -33,13 +33,14 @@ function update_script() {
msg_ok "Services Stopped" msg_ok "Services Stopped"
msg_info "Updating Ollama to ${RELEASE}" msg_info "Updating Ollama to ${RELEASE}"
msg_ok ""
TMP_TAR=$(mktemp --suffix=.tgz) TMP_TAR=$(mktemp --suffix=.tgz)
echo -e "\n"
curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz" curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz"
tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama
ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama
echo "${RELEASE}" >/opt/Ollama_version.txt echo "${RELEASE}" >/opt/Ollama_version.txt
msg_ok "Updated Ollama" msg_info ""
msg_ok "Updated Ollama to ${RELEASE}"
msg_info "Starting Services" msg_info "Starting Services"
systemctl start ollama systemctl start ollama

View File

@ -1,80 +0,0 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://sabnzbd.org/
APP="SABnzbd"
var_tags="${var_tags:-downloader}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/sabnzbd ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" = "$(cat /opt/${APP}_version.txt)" ]]; then
msg_ok "No update required. ${APP} is already at ${RELEASE}"
exit
fi
msg_info "Updating $APP to ${RELEASE}"
systemctl stop sabnzbd
cp -r /opt/sabnzbd /opt/sabnzbd_backup_$(date +%s)
tmpdir=$(mktemp -d)
curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" | tar -xz -C "$tmpdir"
cp -rf "${tmpdir}/SABnzbd-${RELEASE}/"* /opt/sabnzbd/
rm -rf "$tmpdir"
if [[ ! -d /opt/sabnzbd/venv ]]; then
msg_info "Migrating SABnzbd to venv installation"
$STD python3 -m venv /opt/sabnzbd/venv
source /opt/sabnzbd/venv/bin/activate
$STD pip install --upgrade pip
if [[ -f /opt/sabnzbd/requirements.txt ]]; then
$STD pip install -r /opt/sabnzbd/requirements.txt
fi
deactivate
if grep -q "ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then
sed -i "s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service
systemctl daemon-reload
msg_ok "Migrated SABnzbd to venv installation and updated Service"
fi
else
source /opt/sabnzbd/venv/bin/activate
$STD pip install --upgrade pip
$STD pip install -r /opt/sabnzbd/requirements.txt
deactivate
fi
echo "${RELEASE}" >/opt/${APP}_version.txt
systemctl start sabnzbd
msg_ok "Updated ${APP} to ${RELEASE}"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"

View File

@ -1,77 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://sabnzbd.org/
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 \
par2 \
p7zip-full
msg_ok "Installed Dependencies"
msg_info "Setup Python3"
$STD apt-get install -y \
python3-dev \
python3-pip \
python3-venv \
python3-setuptools
msg_ok "Setup Python3"
msg_info "Setup Unrar"
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
msg_ok "Setup Unrar"
msg_info "Installing SABnzbd"
RELEASE=$(curl -fsSL 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
$STD python3 -m venv /opt/sabnzbd/venv
source /opt/sabnzbd/venv/bin/activate
$STD pip install --upgrade pip
$STD pip install -r /opt/sabnzbd/requirements.txt
deactivate
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed SABnzbd"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/sabnzbd.service
[Unit]
Description=SABnzbd
After=network.target
[Service]
WorkingDirectory=/opt/sabnzbd
ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py -s 0.0.0.0:7777
Restart=always
User=root
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now sabnzbd
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"