11#! /usr/bin/env bash
22source <( curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3- # Copyright (c) 2021-2025 tteck
4- # Author: tteck (tteckster)
3+ # Copyright (c) 2021-2025 community-scripts ORG
4+ # Author: tteck (tteckster) | Co-Author: Slaviša Arežina (tremor021)
55# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66# Source: https://www.qbittorrent.org/
77
@@ -27,10 +27,36 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- msg_info " Updating ${APP} LXC"
31- $STD apt-get update
32- $STD apt-get -y upgrade
33- msg_ok " Updated ${APP} LXC"
30+ if [[ ! -f /opt/${APP} _version.txt ]]; then
31+ touch /opt/${APP} _version.txt
32+ mkdir -p $HOME /.config/qBittorrent/
33+ mkdir -p /opt/qbittorrent/
34+ mv /.config/qBittorrent $HOME /.config/
35+ $STD apt-get remove --purge -y qbittorrent-nox
36+ sed -i ' s@ExecStart=/usr/bin/qbittorrent-nox@ExecStart=/opt/qbittorrent/qbittorrent-nox@g' /etc/systemd/system/qbittorrent-nox.service
37+ systemctl daemon-reload
38+ fi
39+ FULLRELEASE=$( curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3) }' )
40+ RELEASE=$( echo $FULLRELEASE | cut -c 9-13)
41+ if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
42+ msg_info " Stopping Service"
43+ systemctl stop qbittorrent-nox
44+ msg_ok " Stopped Service"
45+
46+ msg_info " Updating ${APP} to v${RELEASE} "
47+ rm -f /opt/qbittorrent/qbittorrent-nox
48+ curl -fsSL " https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE} /x86_64-qbittorrent-nox" -o /opt/qbittorrent/qbittorrent-nox
49+ chmod +x /opt/qbittorrent/qbittorrent-nox
50+ echo " ${RELEASE} " > /opt/${APP} _version.txt
51+ msg_ok " Updated $APP to v${RELEASE} "
52+
53+ msg_info " Starting Service"
54+ systemctl start qbittorrent-nox
55+ msg_ok " Started Service"
56+ msg_ok " Updated Successfully"
57+ else
58+ msg_ok " No update required. ${APP} is already at v${RELEASE} "
59+ fi
3460 exit
3561}
3662
@@ -41,4 +67,4 @@ description
4167msg_ok " Completed Successfully!\n"
4268echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
4369echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
44- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :8090${CL} "
70+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :8090${CL} "
0 commit comments