#!/usr/bin/tclsh proc TouchFile {file} { set f [open $file w] puts $f " " close $f } set file "/tmp/.kill_mythfrontend_from_remote" if { [file exists $file] } { set f_date [file mtime $file] set now [clock seconds] if { [expr $now - $f_date < 4] } { catch {exec /usr/bin/pkill mythfrontend} ret # ifpkill did not work, try kill -9 if { $ret != 0 } { catch {exec /usr/bin/pkill -9 mythfrontend} ret } } TouchFile $file } else { TouchFile $file }