initial commit of bin scripts into git
This commit is contained in:
23
kill_mythfrontend_from_remote
Executable file
23
kill_mythfrontend_from_remote
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
}
|
||||
Reference in New Issue
Block a user