From dc2e0226f91cee87b1c4157f91215caac8b6d929 Mon Sep 17 00:00:00 2001 From: "Kurt J. Bosch" Date: Tue, 28 Jun 2011 00:20:15 +0200 Subject: rc.sysinit: Refactor /etc/mtab symlink detection to avoid empty if clause --- rc.sysinit | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rc.sysinit') 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 -- cgit v1.2.3