Update sabnzbd-v5.sh

create update
This commit is contained in:
tteckster 2023-03-20 15:48:20 -04:00 committed by GitHub
parent c43dcea48e
commit 92596e8955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -353,10 +353,16 @@ header_info
function update_script() { function update_script() {
header_info header_info
msg_info "Updating $APP LXC" msg_info "Updating $APP"
apt-get update &>/dev/null systemctl stop sabnzbd.service
apt-get -y upgrade &>/dev/null RELEASE=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
msg_ok "Updated $APP LXC" tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz) &>/dev/null
\cp -r SABnzbd-${RELEASE}/* /opt/sabnzbd &>/dev/null
rm -rf SABnzbd-${RELEASE}
cd /opt/sabnzbd
python3 -m pip install -r requirements.txt &>/dev/null
systemctl start sabnzbd.service
msg_ok "Updated $APP"
exit exit
} }
@ -375,7 +381,7 @@ if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/sabnzbd ]]; then
fi fi
if ! command -v pveversion >/dev/null 2>&1; then if ! command -v pveversion >/dev/null 2>&1; then
if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP}. Proceed?" 10 58); then
clear clear
echo -e "⚠ User exited script \n" echo -e "⚠ User exited script \n"
exit exit