aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-28 00:20:15 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-28 15:39:42 +0200
commitdc2e0226f91cee87b1c4157f91215caac8b6d929 (patch)
tree99ceb30b0246f978883bc0b7210f65a6c872f5bc /rc.sysinit
parentad1713018daa1905908c7e26bfa976eff3a8459f (diff)
downloadinitscripts-dc2e0226f91cee87b1c4157f91215caac8b6d929.tar.xz
rc.sysinit: Refactor /etc/mtab symlink detection to avoid empty if clause
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit12
1 files changed, 6 insertions, 6 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 89cbd55..7f1089e 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -182,12 +182,12 @@ status "Remounting Root Read/Write" \
mount -n -o remount,rw /
# don't touch /etc/mtab if it is a symlink to /proc/self/mounts
-if [[ -L /etc/mtab ]]; then
- :
-elif [[ -x $(type -P findmnt) && -e /proc/self/mountinfo ]]; then
- findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab
-else
- cat /proc/mounts >| /etc/mtab
+if [[ ! -L /etc/mtab ]]; then
+ if [[ -x $(type -P findmnt) && -e /proc/self/mountinfo ]]; then
+ findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab
+ else
+ cat /proc/mounts >| /etc/mtab
+ fi
fi
# now mount all the local filesystems