@@ -27,20 +27,35 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- msg_info " Updating $APP "
31- systemctl stop overseerr
32- cd /opt/overseerr
33- output=$( git pull)
34- $STD git pull
35- if echo " $output " | grep -q " Already up to date." ; then
36- msg_ok " $APP is already up to date."
30+
31+ RELEASE=$( curl -fsSL https://api.github.com/repos/sct/overseerr/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
32+ if [[ ! -f ~ /.overseerr ]] || [[ " ${RELEASE} " != " $( cat ~ /.overseerr) " ]]; then
33+ msg_info " Stopping ${APP} service"
34+ systemctl stop overseerr
35+ msg_ok " Service stopped"
36+
37+ msg_info " Creating backup"
38+ mv /opt/overseerr/config /opt/config_backup
39+ msg_ok " Backup created"
40+
41+ fetch_and_deploy_gh_release " overseerr" " sct/overseerr" " tarball"
42+ rm -rf /opt/overseerr/config
43+
44+ msg_info " Configuring ${APP} (Patience)"
45+ cd /opt/overseerr
46+ $STD yarn install
47+ $STD yarn build
48+ mv /opt/config_backup /opt/overseerr/config
49+ msg_ok " Configured ${APP} "
50+
51+ msg_info " Starting ${APP} service"
3752 systemctl start overseerr
38- exit
53+ msg_ok " Started ${APP} service"
54+
55+ msg_ok " Updated successfully!"
56+ else
57+ msg_ok " No update required. ${APP} is already at ${RELEASE} "
3958 fi
40- $STD yarn install
41- $STD yarn build
42- systemctl start overseerr
43- msg_ok " Updated $APP "
4459 exit
4560}
4661
@@ -51,4 +66,4 @@ description
5166msg_ok " Completed Successfully!\n"
5267echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
5368echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
54- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :5055${CL} "
69+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :5055${CL} "
0 commit comments