@@ -20,46 +20,45 @@ color
2020catch_errors
2121
2222function update_script() {
23- header_info
24- check_container_storage
25- check_container_resources
26- if [[ ! -d /home/wger ]]; then
27- msg_error " No ${APP} Installation Found!"
28- exit
29- fi
30- RELEASE=$( curl -fsSL https://api.github.com/repos/wger-project/wger/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3)}' )
31- if [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
32- msg_info " Stopping $APP "
33- systemctl stop wger
34- msg_ok " Stopped $APP "
23+ header_info
24+ check_container_storage
25+ check_container_resources
26+ if [[ ! -d /home/wger ]]; then
27+ msg_error " No ${APP} Installation Found!"
28+ exit
29+ fi
30+ RELEASE=$( curl -fsSL https://api.github.com/repos/wger-project/wger/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3)}' )
31+ if [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
32+ msg_info " Stopping $APP "
33+ systemctl stop wger
34+ msg_ok " Stopped $APP "
3535
36- msg_info " Updating $APP to v${RELEASE} "
37- temp_file=$( mktemp)
38- cd $temp_file
39- curl -fsSL " https://github.com/wger-project/wger/archive/refs/tags/$RELEASE .tar.gz" -o " $temp_file "
40- tar xzf $temp_file
41- cp -rf wger-$RELEASE /* /home/wger/src
42- cd /home/wger/src
43- python3 manage.py migrate & > /dev/null
44- yarn install & > /dev/null
45- yarn build:css:sass & > /dev/null
46- python3 manage.py collectstatic --noinput & > /dev/null
47- echo " ${RELEASE} " > /opt/${APP} _version.txt
48- msg_ok " Updated $APP to v${RELEASE} "
36+ msg_info " Updating $APP to v${RELEASE} "
37+ temp_file=$( mktemp)
38+ curl -fsSL " https://github.com/wger-project/wger/archive/refs/tags/$RELEASE .tar.gz" -o " $temp_file "
39+ tar xzf " $temp_file "
40+ cp -rf wger-" $RELEASE " /* /home/wger/src
41+ cd /home/wger/src
42+ python3 manage.py migrate & > /dev/null
43+ yarn install & > /dev/null
44+ yarn build:css:sass & > /dev/null
45+ python3 manage.py collectstatic --noinput & > /dev/null
46+ echo " ${RELEASE} " > /opt/${APP} _version.txt
47+ msg_ok " Updated $APP to v${RELEASE} "
4948
50- msg_info " Starting $APP "
51- systemctl start wger
52- msg_ok " Started $APP "
49+ msg_info " Starting $APP "
50+ systemctl start wger
51+ msg_ok " Started $APP "
5352
54- msg_info " Cleaning Up"
55- rm -rf $temp_file
56- msg_ok " Cleanup Completed"
53+ msg_info " Cleaning Up"
54+ rm -rf " $temp_file "
55+ msg_ok " Cleanup Completed"
5756
58- msg_ok " Update Successful"
59- else
60- msg_ok " No update required. ${APP} is already at v${RELEASE} "
61- fi
62- exit
57+ msg_ok " Update Successful"
58+ else
59+ msg_ok " No update required. ${APP} is already at v${RELEASE} "
60+ fi
61+ exit
6362}
6463
6564start
@@ -69,4 +68,4 @@ description
6968msg_ok " Completed Successfully!\n"
7069echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
7170echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
72- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :3000${CL} "
71+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :3000${CL} "
0 commit comments