Skip to content

Commit

Permalink
added update-check.cgi which takes care of performing update checks f…
Browse files Browse the repository at this point in the history
…or the addon.
  • Loading branch information
jens-maus committed Oct 9, 2015
1 parent 03399c7 commit 8030c49
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
22 changes: 22 additions & 0 deletions script/update-check.cgi
@@ -0,0 +1,22 @@
#!/bin/tclsh

catch {
set input $env(QUERY_STRING)
set pairs [split $input &]
foreach pair $pairs {
if {0 != [regexp "^(\[^=]*)=(.*)$" $pair dummy varname val]} {
set $varname $val
}
}
}

if { [info exists cmd ] && $cmd == "download"} {
if { [info exists version ] } {
puts "<meta http-equiv='refresh' content='0; url=https://github.com/jens-maus/scriptparser/releases/tag/$version' />"
} else {
puts "<meta http-equiv='refresh' content='0; url=https://github.com/jens-maus/scriptparser/releases' />"
}
} else {
set version [ exec /usr/bin/wget -qO- --no-check-certificate https://raw.githubusercontent.com/jens-maus/scriptparser/master/VERSION ]
puts $version
}
2 changes: 1 addition & 1 deletion scriptparser
Expand Up @@ -14,7 +14,7 @@ case "$1" in
echo "Version: $VER"
echo "Operations: uninstall"
echo "Config-Url: /addons/script"
#echo "Update: http://raw.githubusercontent.com/jens-maus/scriptparser/master/VERSION"
echo "Update: /addons/script/update-check.cgi"
;;

uninstall)
Expand Down
5 changes: 5 additions & 0 deletions update_script
Expand Up @@ -16,10 +16,15 @@ elif [ "$1" == "HM-RASPBERRYMATIC" ]; then
mount /usr/local
fi

# cleanup
mkdir -p $WWWDIR
rm -rf $WWWDIR/*

# copy data
cp -R $ADDONNAME/* $WWWDIR/
chmod 755 $WWWDIR

# copy rc.d
cp scriptparser $RCDDIR/
chmod +x $RCDDIR/scriptparser

Expand Down

0 comments on commit 8030c49

Please sign in to comment.