httpd.tcl changes

John Schult johndavid65 at h...
Sun, 10 Jun 2001 00:48:31 -0000


Hi all,

I am interested in working on some of the code in the httpd.tcl that 
is being used for ExtractStream. I am not sure who is maintaining 
the code base for ExtractStream?

Anyway, one of the things (I know it is minor) in httpd.tcl that I 
wanted to fix was the way it displays the remount info. Here is my 
rewrite:

<snip>

proc action_remount {chan path} {
if {[string index $path 0] == "/"} {
set path [string range $path 1 end]
}

puts $chan [html_start "TivoHack Web Remote"]
puts $chan "<B>TiVoHack Web Root Remount</B><BR>"

if {$path == "ro" } {
exec mount -oremount,ro /
} elseif {$path == "rw" } {
exec mount -oremount,rw /
}

# check to see how / is currently mounted
variable mount_out [exec mount]
set mount_out [ string range $mount_out 0 [ string first ")" 
$mount_out ] ]
variable remount "ro"
variable remount_txt "Read Only"
if { [regexp -nocase {\(ro\)} $mount_out] } {
puts $chan "/ is currently mounted <FONT COLOR=\"red\">Read 
Only</FONT> <PRE>\[$mount_out\]</PRE>"
set remount "rw"
set remount_txt "Read Write"
} else {
puts $chan "/ is currently mounted <FONT COLOR=\"green\">Read 
Write</FONT> <PRE>\[$mount_out\]</PRE>"
}
puts $chan "<HR>"

puts $chan "Remount / as "
variable link [html_link $remount $remount_txt]
puts -nonewline $chan $link

puts $chan "<BR>"
puts $chan [html_end]
}

<snip>

I am going to change more of the interface and if you would like to 
see this contributed, let me know.

John