1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 13:37:40 +02:00

Execute cgi instead of using wget to get available version in http-auth enabled environments.

This commit is contained in:
Jan Schneider 2018-08-27 20:49:39 +02:00
parent 050bca88c4
commit 058e3e56dc

View File

@ -1461,9 +1461,17 @@ proc ::rmupdate::get_addon_info {{fetch_available_version 0} {fetch_download_url
set addons(${id}::${keyl}) $value
if {$keyl == "update" && $fetch_available_version == 1} {
catch {
#set cgi "${addons_www_dir}/[string range $value 8 end]"
#set available_version [exec tclsh "$cgi"]
set cgi "${addons_www_dir}/[string range $value 8 end]"
set cfd [open $cgi r]
set cgi_data [read $cfd]
close $cfd
set firstline [lindex [split $cgi_data "\n"] 0]
write_log 1 "firstline: ${firstline}"
regexp {^#!(.*)$} $firstline match cmd
set available_version [exec $cmd "$cgi"]
if {!$available_version} {
set available_version [exec /usr/bin/wget "http://localhost${value}" --quiet --output-document=-]
}
set addons(${id}::available_version) $available_version
}
}