aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2017-07-24 14:33:58 +0200
committerDee'Kej <deekej@linuxmail.org>2017-08-07 13:23:56 +0200
commitc54ab62d189a88e677aa0520df07da87363a8a61 (patch)
tree84eb5fde25e28b99edbf5ee40a65ae1eb538dfa2
parent3bd816fb3a30e085cfac69d14f61243920472f65 (diff)
downloadinitscripts-c54ab62d189a88e677aa0520df07da87363a8a61.tar
initscripts-c54ab62d189a88e677aa0520df07da87363a8a61.tar.gz
initscripts-c54ab62d189a88e677aa0520df07da87363a8a61.tar.bz2
initscripts-c54ab62d189a88e677aa0520df07da87363a8a61.tar.xz
initscripts-c54ab62d189a88e677aa0520df07da87363a8a61.zip
init.d/functions: is_true() & is_false() extended by ON/OFF support
In some cases we are using "on" or "off" as values. is_true() and is_false() can be used for evaluation of these values as well.
-rw-r--r--rc.d/init.d/functions4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index d54361c3..fd685682 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -644,7 +644,7 @@ convert2sec() {
# Evaluate shvar-style booleans
is_true() {
case "$1" in
- [tT] | [yY] | [yY][eE][sS] | [tT][rR][uU][eE] | 1)
+ [tT] | [yY] | [yY][eE][sS] | [oO][nN] | [tT][rR][uU][eE] | 1)
return 0
;;
esac
@@ -654,7 +654,7 @@ is_true() {
# Evaluate shvar-style booleans
is_false() {
case "$1" in
- [fF] | [nN] | [nN][oO] | [fF][aA][lL][sS][eE] | 0)
+ [fF] | [nN] | [nN][oO] | [oO][fF][fF] | [fF][aA][lL][sS][eE] | 0)
return 0
;;
esac