aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rc.d/init.d/functions21
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'