File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ case "$1" in
65
65
echo " Info: <ul><li><a href=" https://github.com/hobbyquaker/ccu-addon-node-red" >ccu-addon-node-red on Github</a></li></ul>"
66
66
echo " Name: Node-RED"
67
67
echo " Version: $ADDON_VERSION "
68
+ echo " Update: /addons/check_update_node_red.cgi"
68
69
echo " Operations: restart uninstall"
69
70
;;
70
71
@@ -75,6 +76,7 @@ case "$1" in
75
76
rm $CONF_DIR /lighttpd/node-red.conf
76
77
rm $CONF_DIR /rc.d/node-red
77
78
rm /usr/local/bin/node-red-admin
79
+ rm /usr/local/etc/config/addons/www/check_update_node_red.cgi
78
80
;;
79
81
80
82
* )
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env tclsh
2
+
3
+ set checkURL " https://api.github.com/repos/hobbyquaker/ccu-addon-node-red/releases/latest"
4
+ set downloadURL " https://github.com/hobbyquaker/ccu-addon-node-red/releases/latest"
5
+
6
+ catch {
7
+ set input $env(QUERY_STRING)
8
+ set pairs [split $input &]
9
+ foreach pair $pairs {
10
+ if {0 != [regexp "^(\[ ^=]*)=(.*)$" $pair dummy varname val]} {
11
+ set $varname $val
12
+ }
13
+ }
14
+ }
15
+
16
+ if { [info exists cmd ] && $cmd == " download" } {
17
+ puts " <html><head><meta http-equiv='refresh' content='0; url=$downloadURL ' /></head></html>"
18
+ } else {
19
+ catch {
20
+ [regexp "tag_name\" : \" v(\[ 0-9\] +\.\[ 0-9\] +\.\[ 0-9\] +)" [ exec /usr/bin/env wget -qO- --no-check-certificate $checkURL ] dummy newversion]
21
+ }
22
+ if { [info exists newversion] } {
23
+ puts -nonewline $newversion
24
+ } else {
25
+ puts -nonewline " n/a"
26
+ }
27
+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ if [ ! -f $RED_DIR/var/flows.json ]; then
33
33
mv $RED_DIR /var/example-flows.json $RED_DIR /var/flows.json
34
34
fi
35
35
36
+ ln -s $RED_DIR /update_check.tcl /usr/local/etc/config/addons/www/check_update_node_red.cgi
37
+
36
38
touch $CONF_DIR /hm_addons.cfg
37
39
sed -i ' /node-red/d' $CONF_DIR /hm_addons.cfg
38
40
x=$( tail -c 1 $CONF_DIR /hm_addons.cfg)
You can’t perform that action at this time.
0 commit comments