source/helper.tcl
| Procedure Summary |
ask { args }A convenience proc to prompt the user for some value. |
blocks { script } |
break_event { sid } |
busybox_has { feature }Check that the installed busybox supports a specific |
checkfs { type path {flags {}} {text {}} }Check that a filesystem entity exists and it has specific properties. |
isdomainname { str }Checks that a string is a valid IP domain name. |
isemail { str } |
ishostname { str }Checks that a string is a valid IP hostname. |
isip { str }Checks if an string represents a legal IP address (v4 or |
isip4 { str }Checks if an string represents a legal IPv4 |
isip6 { str }Checks if an string represents a legal IPv6 |
isipport { port }Check if a string is a valid TCP/UDP port |
isrunning { name }Find if a certain executable (usually a daemon) is |
kernel_has { feature }Check that the running kernel supports a specific |
kill { sig ps }Send a signal to a process. |
killall { name }Kill all processses with the specified name. |
parseconf { gvar filepath args } |
pidof { name }Return a list of process ids for all the processes with executable |
removeline { filepath pattern }Remove lines from a file that match a given pattern. |
secs2age { secs {format -full} }Convert a duration in secs to a string describing the duration, involving days, hours, mins & secs. |
sflush { args }Access the version of "flush" of the |
sgets { args }Access the version of "gets" of the |
sputs { args }Access the version of "puts" of the |
sread { args }Access the version of "read" of the |
timeout { secs script }Execute a script in the context of the caller, but wait up to $secs number of secs for the script to finish evaluation. |
| Procedure Detail |
proc ask { args }
args - See description above.
proc blocks { script }
proc break_event { sid }
proc busybox_has { feature }
feature - The name of the feature to be checked, e.g. CONFIG_ASH
proc checkfs { type path {flags {}} {text {}} }
type - "-dir" or "-file"
path - The path of the entity.
flags - A list of flags to check.
text - The text to write to the file, if it is being created (flag 'c').
@error
proc isdomainname { str }
str - The input string to check.
proc isemail { str }
str - The input string to check.
proc ishostname { str }
str - The input string to check.
proc isip { str }
str - The input string to check.
proc isip4 { str }
str - The input string to check.
proc isip6 { str }
str - The input string to check.
proc isipport { port }
proc isrunning { name }
name - Name of executable e.g. syslogd
proc kernel_has { feature }
feature - The name of the feature to be checked, e.g. CONFIG_INOTIFY.
proc kill { sig ps }
proc killall { name }
name - Name of executable e.g. syslogd
@todo Check to see if it was actually killed, and log error if not.
proc parseconf { gvar filepath args }
proc pidof { name }
name - Name of executable e.g. syslogd
proc removeline { filepath pattern }
filepath - The filepath of the file. The file must pre-exist.
pattern - A "string match" pattern.
@error
proc secs2age { secs {format -full} }
secs - Absolute number of seconds.
format - Requests a specific format for the returned string. Supported: -full -simple
proc sflush { args }
args - The standard "flush" arguments.
proc sgets { args }
args - The standard "flush" arguments.
proc sputs { args }
args - The standard "flush" arguments.
proc sread { args }
args - The standard "flush" arguments.
proc timeout { secs script }
secs - Number of seconds to wait.
script - Script to execute.
@error