summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2012-02-03 13:50:35 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2012-02-03 13:58:08 +0100
commite88c1e1781f453db2de6ea46cc574c237c042a6a (patch)
tree3e8e3836d40fe2050e5b99462a5e9f3e7ec6c7e9
parent05d1c04cf9e5916de8550115dc578e91d29651cd (diff)
Small style cleanup
* Add whitespace to arithmetic expressions. * Use boolean logic for semantically boolean variables. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--functions2
-rwxr-xr-xnetwork4
-rwxr-xr-xrc.d8
-rwxr-xr-xrc.sysinit2
4 files changed, 8 insertions, 8 deletions
diff --git a/functions b/functions
index 24da795..833711b 100644
--- a/functions
+++ b/functions
@@ -662,7 +662,7 @@ need_root() {
# Quit script if it's not running by root
# This can be disabled in scripts sourcing functions by setting NEED_ROOT=0
# A local call to need_root can be done to ensure part of script need root privilege
-(( ${NEED_ROOT:-0} == 1 )) && need_root
+(( NEED_ROOT )) && need_root
# End of file
# vim: set ts=2 sw=2 noet:
diff --git a/network b/network
index d22b5dd..faaac78 100755
--- a/network
+++ b/network
@@ -260,7 +260,7 @@ case "$1" in
else
network_up
fi
- if ((error == 0)); then
+ if (( ! error )); then
add_daemon network
stat_done
else
@@ -296,7 +296,7 @@ case "$1" in
else
network_down
fi
- if ((error == 0)); then
+ if (( ! error )); then
stat_done
else
stat_fail
diff --git a/rc.d b/rc.d
index aed2e42..115dc05 100755
--- a/rc.d
+++ b/rc.d
@@ -41,10 +41,10 @@ not exist or is not executable.${C_CLEAR}\n" >&2
exit 2
fi
# check filter
- ((${filter[started]} == 1)) && ck_daemon "$daemon" && continue
- ((${filter[stopped]} == 1)) && ! ck_daemon "$daemon" && continue
- ((${filter[auto]} == 1)) && ck_autostart "$daemon" && continue
- ((${filter[noauto]} == 1)) && ! ck_autostart "$daemon" && continue
+ (( ${filter[started]} )) && ck_daemon "$daemon" && continue
+ (( ${filter[stopped]} )) && ! ck_daemon "$daemon" && continue
+ (( ${filter[auto]} )) && ck_autostart "$daemon" && continue
+ (( ${filter[noauto]} )) && ! ck_autostart "$daemon" && continue
new_daemons+=("$daemon")
done
daemons=("${new_daemons[@]}")
diff --git a/rc.sysinit b/rc.sysinit
index 27ad124..458239e 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -169,7 +169,7 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
crypto_unlocked=0
read_crypttab do_unlock && stat_done || stat_fail
# Maybe someone has LVM on an encrypted block device
- (( crypto_unlocked == 1 )) && activate_vgs
+ (( crypto_unlocked )) && activate_vgs
fi
# Check filesystems