proc action_remount {chan path env} {
if {[string index $path 0] == "/"} {
set path [string range $path 1 end]
}
puts $chan [html_start ""]
puts $chan "TiVoHack Web Root Remount $path
"
if {$path == "ro" } {
puts $chan "/ Remounted Read Only"
exec mount -oremount,ro /
} elseif {$path == "rw" } {
puts $chan "/ remounted Read Write"
exec mount -oremount,rw /
}
puts $chan "Remount /
"
puts -nonewline $chan [html_link "ro" "Read Only"]
puts $chan "
"
puts -nonewline $chan [html_link "rw" "Read Write"]
puts $chan [html_end]
}
register_module "remount" "Remount Root" "Remount the TiVo Root Filesystem as Read-Write or Read-Only"