@@ -20,39 +20,39 @@ color
2020catch_errors
2121
2222function update_script() {
23- header_info
24- check_container_storage
25- check_container_resources
26- if [[ ! -f /etc/systemd/system/zitadel.service ]]; then
27- msg_error " No ${APP} Installation Found!"
28- exit
29- fi
30- RELEASE=$( curl -fsSL https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d ' / ' -f 8 | tr -d ' \r ' )
31- if [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt | grep -oP ' \d+\.\d+\.\d+' ) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
32- msg_info " Stopping $APP "
33- systemctl stop zitadel
34- msg_ok " Stopped $APP "
23+ header_info
24+ check_container_storage
25+ check_container_resources
26+ if [[ ! -f /etc/systemd/system/zitadel.service ]]; then
27+ msg_error " No ${APP} Installation Found!"
28+ exit
29+ fi
30+ RELEASE=$( curl -fsSL https://api. github.com/repos/ zitadel/zitadel/releases/latest | grep " tag_name " | awk ' {print substr($2, 3, length($2)-4) } ' )
31+ if [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt | grep -oP ' \d+\.\d+\.\d+' ) " ]] || [[ ! -f /opt/${APP} _version.txt ]]; then
32+ msg_info " Stopping $APP "
33+ systemctl stop zitadel
34+ msg_ok " Stopped $APP "
3535
36- msg_info " Updating $APP to ${RELEASE} "
37- cd /tmp || exit
38- curl -fsSL https://github.com/zitadel/zitadel/releases/download/" $RELEASE " /zitadel-linux-amd64.tar.gz | tar -xz
39- mv zitadel-linux-amd64/zitadel /usr/local/bin
40- $STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true
41- echo " ${RELEASE} " > /opt/${APP} _version.txt
42- msg_ok " Updated $APP to ${RELEASE} "
36+ msg_info " Updating $APP to ${RELEASE} "
37+ cd /tmp || exit
38+ curl -fsSL " https://github.com/zitadel/zitadel/releases/download/v $RELEASE /zitadel-linux-amd64.tar.gz" | tar -xz
39+ mv zitadel-linux-amd64/zitadel /usr/local/bin
40+ $STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true
41+ echo " ${RELEASE} " > /opt/${APP} _version.txt
42+ msg_ok " Updated $APP to ${RELEASE} "
4343
44- msg_info " Starting $APP "
45- systemctl start zitadel
46- msg_ok " Started $APP "
44+ msg_info " Starting $APP "
45+ systemctl start zitadel
46+ msg_ok " Started $APP "
4747
48- msg_info " Cleaning Up"
49- rm -rf /tmp/zitadel-linux-amd64
50- msg_ok " Cleanup Completed"
51- msg_ok " Update Successful"
52- else
53- msg_ok " No update required. ${APP} is already at ${RELEASE} "
54- fi
55- exit
48+ msg_info " Cleaning Up"
49+ rm -rf /tmp/zitadel-linux-amd64
50+ msg_ok " Cleanup Completed"
51+ msg_ok " Update Successful"
52+ else
53+ msg_ok " No update required. ${APP} is already at ${RELEASE} "
54+ fi
55+ exit
5656}
5757
5858start
0 commit comments