@@ -27,22 +27,24 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- msg_info " Stopping ${APP} LXC"
31- systemctl stop autobrr.service
32- msg_ok " Stopped ${APP} LXC"
33-
34- msg_info " Updating ${APP} LXC"
35- rm -rf /usr/local/bin/*
36- curl -fsSL " $( curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4) " -o $( basename " $( curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4) " )
37- tar -C /usr/local/bin -xzf autobrr* .tar.gz
38- rm -rf autobrr* .tar.gz
39- msg_ok " Updated ${APP} LXC"
40-
41- msg_info " Starting ${APP} LXC"
42- systemctl start autobrr.service
43- msg_ok " Started ${APP} LXC"
44- msg_ok " Updated Successfully"
45- exit
30+
31+ RELEASE=$( curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
32+ if [[ " ${RELEASE} " != " $( cat ~ /.autobrr 2> /dev/null) " ]] || [[ ! -f ~ /.autobrr ]]; then
33+ msg_info " Stopping ${APP} LXC"
34+ systemctl stop autobrr
35+ msg_ok " Stopped ${APP} LXC"
36+
37+ fetch_and_deploy_gh_release " autobrr" " autobrr/autobrr" " prebuild" " latest" " /usr/local/bin" " autobrr_*_linux_x86_64.tar.gz"
38+
39+ msg_info " Starting ${APP} LXC"
40+ systemctl start autobrr
41+ msg_ok " Started ${APP} LXC"
42+
43+ msg_ok " Updated Successfully"
44+ else
45+ msg_ok " No update required. ${APP} is already at ${RELEASE} "
46+ fi
47+ exit
4648}
4749
4850start
0 commit comments