@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
1111var_ram=" ${var_ram:- 2048} "
1212var_disk=" ${var_disk:- 10} "
1313var_os=" ${var_os:- debian} "
14- var_version=" ${var_version:- 12 } "
14+ var_version=" ${var_version:- 13 } "
1515var_unprivileged=" ${var_unprivileged:- 1} "
1616
1717header_info " $APP "
@@ -20,43 +20,46 @@ color
2020catch_errors
2121
2222function update_script() {
23- header_info
24- check_container_storage
25- check_container_resources
26- if [[ ! -d /opt/tasmocompiler ]]; then
27- msg_error " No ${APP} Installation Found!"
28- exit
29- fi
30- RELEASE=$( curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
31- if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
32- msg_info " Stopping $APP "
33- systemctl stop tasmocompiler
34- msg_ok " Stopped $APP "
35- msg_info " Updating $APP to v${RELEASE} "
36- cd /opt
37- rm -rf /opt/tasmocompiler
38- RELEASE=$( curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
39- curl -fsSL " https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE} .tar.gz" -o $( basename " https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE} .tar.gz" )
40- tar xzf v${RELEASE} .tar.gz
41- mv tasmocompiler-${RELEASE} / /opt/tasmocompiler/
42- cd /opt/tasmocompiler
43- $STD yarn install
44- export NODE_OPTIONS=--openssl-legacy-provider
45- $STD npm i
46- $STD yarn build
47- msg_ok " Updated $APP to v${RELEASE} "
48- msg_info " Starting $APP "
49- systemctl start tasmocompiler
50- msg_ok " Started $APP "
51- echo " ${RELEASE} " > /opt/${APP} _version.txt
52- msg_info " Cleaning up"
53- rm -r " /opt/v${RELEASE} .tar.gz"
54- msg_ok " Cleaned"
55- msg_ok " Update Successful"
56- else
57- msg_ok " No update required. ${APP} is already at v${RELEASE} "
58- fi
23+ header_info
24+ check_container_storage
25+ check_container_resources
26+ if [[ ! -d /opt/tasmocompiler ]]; then
27+ msg_error " No ${APP} Installation Found!"
5928 exit
29+ fi
30+ RELEASE=$( curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
31+ if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
32+ msg_info " Stopping Service"
33+ systemctl stop tasmocompiler
34+ msg_ok " Stopped Service"
35+
36+ msg_info " Updating TasmoCompiler"
37+ cd /opt
38+ rm -rf /opt/tasmocompiler
39+ RELEASE=$( curl -fsSL https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
40+ curl -fsSL " https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE} .tar.gz" -o $( basename " https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE} .tar.gz" )
41+ tar xzf v${RELEASE} .tar.gz
42+ mv tasmocompiler-${RELEASE} / /opt/tasmocompiler/
43+ cd /opt/tasmocompiler
44+ $STD yarn install
45+ export NODE_OPTIONS=--openssl-legacy-provider
46+ $STD npm i
47+ $STD yarn build
48+ msg_ok " Updated TasmoCompiler"
49+
50+ msg_info " Starting Service"
51+ systemctl start tasmocompiler
52+ msg_ok " Started Service"
53+
54+ echo " ${RELEASE} " > /opt/${APP} _version.txt
55+ msg_info " Cleaning up"
56+ rm -r " /opt/v${RELEASE} .tar.gz"
57+ msg_ok " Cleaned"
58+ msg_ok " Update Successfully!"
59+ else
60+ msg_ok " No update required. ${APP} is already at v${RELEASE} "
61+ fi
62+ exit
6063}
6164
6265start
0 commit comments