Index: openacs-4/packages/acs-core-docs/www/files/openacs.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/openacs.txt,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-core-docs/www/files/openacs.txt 16 Apr 2004 12:59:35 -0000 1.1 +++ openacs-4/packages/acs-core-docs/www/files/openacs.txt 27 Oct 2014 16:39:29 -0000 1.2 @@ -58,10 +58,10 @@ while {[regexp {(.[^\n]+)} $file_contents match_fodder row] } { # remove each row as it's handled set remove_count [string length $row] - set file_contents [string range $file_contents [expr $remove_count + 1] end] + set file_contents [string range $file_contents $remove_count+1 end] # skip comment lines - if { [string equal [string index $row 0] \#] } { + if {[string index $row 0] eq "\#"} { continue } @@ -102,7 +102,7 @@ set time "" # remove each row as it's handled set remove_count [string length $row] - set svstat_txt [string range $svstat_txt [expr $remove_count + 1] end] + set svstat_txt [string range $svstat_txt $remove_count+1 end] regexp {/service/(.+):} $row match_fodder server regexp {:\s([a-z]+)\s} $row match_fodder svc_status regexp {\s([0-9]+)\sseconds} $row match_fodder time @@ -166,7 +166,7 @@ foreach server $server_list { set temp_status [lindex [array get servers ${server}_svc_status] 1] - if { [string equal [string trim $temp_status] up] } { + if {[string trim $temp_status] eq "up"} { set svc_status [lindex [array get servers ${server}_time] 1] } else { set svc_status $temp_status @@ -190,7 +190,7 @@ # if server is not running, start it set status [lindex [array get servers ${server}_svc_status] 1] - if { ![string equal $status "up"]} { + if { $status ne "up" } { puts "Server is not up; starting server" svc_cmd $server start } @@ -253,19 +253,19 @@ # start and restart are based on a key phrase in the log file - if { [string equal $action stop] } { + if {$action eq "stop"} { for { set x 1} { $x<120} {incr x} { # show the log set logline [read $fileId] - if { [string length $logline] > 0 } { + if { $logline ne "" } { puts $logline } # check daemontools svstat_getinfo set status [lindex [array get servers ${server}_svc_status] 1] - if { [string equal $status "down"]} { + if {$status eq "down"} { puts "${server} is down" close $fileId return @@ -277,11 +277,11 @@ puts "gave up waiting after 2 minutes" } } else { - if { [string equal $status "up"] && [string equal $flag "-u"]} { + if { $status eq "up" && $flag eq "-u"} { puts "$server is already up" return } - if { [string equal $status "down"] && [string equal $flag "-t"]} { + if { $status eq "down" && $flag eq "-t"} { puts "$server is down; attempting a start instead of a restart" set flag "-u" @@ -291,7 +291,7 @@ # check the server log every 100 ms for { set x 1} {$x<1200} {incr x} { set logline [read $fileId] - if { [string length $logline] > 0 } { + if { $logline ne "" } { puts $logline if { [regexp "accepting connections" $logline]} { close $fileId @@ -350,28 +350,28 @@ switch -glob -- $arg_1 { start { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { start $arg_2 exit } } stop - restart - reload { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { svc_cmd $arg_2 $arg_1 exit } } status { status - if { [string equal $arg_2 verbose] } { + if {$arg_2 eq "verbose"} { puts $verbose_status } exit } add { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { add $arg_2 exit }