e910472fa6
git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3479 2a923420-c742-0410-a762-8d5b09965624
32 lines
785 B
Plaintext
Executable File
32 lines
785 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
if {[lindex $argv 0] ne "-stop"} exit
|
|
|
|
source /mod/webif/lib/setup
|
|
require system.class settings.class lock
|
|
|
|
set loglevel [[settings] autolog]
|
|
|
|
set file [lindex $argv 1]
|
|
set dir [file dirname $file]
|
|
|
|
set prefix "autotrigger\[[pid]\]"
|
|
if {$loglevel > 0} {
|
|
system plog auto "$prefix: $file"
|
|
system plog auto "$prefix: will run for $dir"
|
|
}
|
|
|
|
# Wait up to 10 minutes for any existing auto process to finish...
|
|
if {![acquire_lock webif_autoscan 600 5]} {
|
|
puts "Cannot acquire exclusive lock, terminating."
|
|
system plog auto "$prefix: failed to get lock"
|
|
exit
|
|
}
|
|
if {$loglevel > 0} { system plog auto "$prefix: got lock" }
|
|
|
|
exec /mod/webif/lib/auto/scan -f -prelocked -logprefix "$prefix: " \
|
|
-singledir $dir
|
|
|
|
if {$loglevel > 0} { system plog auto "$prefix: done" }
|
|
|