diff options
author | Bill Nottingham <notting@redhat.com> | 2010-06-04 14:16:54 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-06-04 14:16:54 -0400 |
commit | cf97478390b735858393eeecbb55b89588b91513 (patch) | |
tree | 38175e3926540fe080410f67a5b2711bc19f3047 | |
parent | f6b18247155df53e10d42472eb95d519565eb560 (diff) | |
download | initscripts-cf97478390b735858393eeecbb55b89588b91513.tar initscripts-cf97478390b735858393eeecbb55b89588b91513.tar.gz initscripts-cf97478390b735858393eeecbb55b89588b91513.tar.bz2 initscripts-cf97478390b735858393eeecbb55b89588b91513.tar.xz initscripts-cf97478390b735858393eeecbb55b89588b91513.zip |
Add functions to check shvar-style variables.
-rw-r--r-- | rc.d/init.d/functions | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 86a5c35d..6768c71d 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -583,5 +583,26 @@ is_ignored_file() { esac return 1 } + +# Evaluate shvar-style booleans +is_true() { + case "$1" in + [tT] | [yY] | [yY][eE][sS] | [tT][rR][uU][eE]) + return 0 + ;; + esac + return 1 +} + +# Evaluate shvar-style booleans +is_false() { + case "$1" in + [fF] | [nN] | [nN][oO] | [fF][aA][lL][sS][eE]) + return 0 + ;; + esac + return 1 +} + # A sed expression to filter out the files that is_ignored_file recognizes __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' |