# c$lchan
# {} for system stuff
if {![llength $debugusers]} return
- if {[regexp {[md]([^:]+)\:} $facil dummy username] &&
+ if {[regexp {[mdu]([^:]+)\:} $facil dummy username] &&
[lsearch -exact $debugusers $username]==-1} return
regsub {^(.)} $facil {\1 } cc
if {![string match *$sq* $s]} continue
set lv $v; break
}
+ if {![info exists dd(ichan)]} return
if {![info exists lv]} {
reporterr "no state for $d matching$s"
return
set cc(time-recentnow) 120
set cc(time-recent) 450
set lno 0
+ set contin {}
foreach l [split $cfg "\n"] {
incr lno
- set l [string trim $l]
+ append contin [string trim $l]
+ if {[regsub {\\$} $contin { } contin]} continue
+ set l $contin
+ set contin {}
if {[regexp {^\#} $l]} {
} elseif {[regexp {^nick\s+(ignore|nopresence|prefer)\s+(\S.*)$} \
$l dummy kind globs]} {
}
ldebug m$m "created"
} elseif {[regexp \
- {^leds\s+([0-9A-Za-z][-:/0-9A-Za-z]+)\s+(\S+)\s+(\S+.*)$} \
+ {^leds\s+([0-9A-Za-z][-.:/0-9A-Za-z]+)\s+(\S+)\s+(\S+.*)$} \
$l dummy g m states]} {
set d $username:$lno:$g
set sl {}
set dd(username) $username
dset_start $d
ldebug d$d "created"
+ } else {
+ error "invalid directive or syntax"
}
}
+ if {[string length $contin]} {
+ error "continuation line at end of file"
+ }
} emsg]} {
reporterr "setup error $username:$lno:$emsg"
return ""
set ochan [open |$cmdl r]
fconfigure $ichan -blocking 0 -buffering line
fconfigure $ochan -blocking 0 -buffering line
- fileevent $ochan readable [list dset_rledout $d]
set dd(ichan) $ichan
set dd(ochan) $ochan
+ fileevent $ochan readable [list dset_rledout $d]
} emsg]} {
reporterr "remoteleds startup $d: $emsg"
catch { close $ichan }
proc_dset rledout {} {
global errchan
while {[gets $dd(ochan) l] != -1} {
- reporterr "remoteleds on $d: $dd(values): $l"
+ reporterr "on $d: $dd(values): $l"
}
if {[fblocked $dd(ochan)]} return
timed_log ">\$$d failure";
catch { close $dd(ochan) }
unset dd(ichan)
unset dd(ochan)
- reporterr "remoteleds on $d died"
+ reporterr "on $d died"
dset_trylater $d
}