From dc0ba7ebf3109b2bbdd73c5f0a411ba6129c2daf Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 9 Oct 2007 15:33:05 +0000 Subject: netmount, localmount, halt.sh and net scripts now check OS specific flags to see if a mount is network mounted (linux = fstab, *bsd = "local" in mount options) or not, #192772. --- sh/rc-functions.sh | 5 +++++ sh/rc-mount.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sh') diff --git a/sh/rc-functions.sh b/sh/rc-functions.sh index 0e149432..c3f60dd7 100755 --- a/sh/rc-functions.sh +++ b/sh/rc-functions.sh @@ -26,6 +26,11 @@ stop_addon() { is_net_fs() { [ -z "$1" ] && return 1 + # Check OS specific flags to see if we're local or net mounted + mountinfo --quiet --netdev "$1" && return 0 + mountinfo --quiet --nonetdev "$1" && return 1 + + # Fall back on fs types local t=$(mountinfo --fstype "$1") for x in ${RC_NET_FS_LIST}; do [ "${x}" = "${t}" ] && return 0 diff --git a/sh/rc-mount.sh b/sh/rc-mount.sh index 94de3b65..08839c3e 100644 --- a/sh/rc-mount.sh +++ b/sh/rc-mount.sh @@ -12,8 +12,8 @@ do_unmount() { f_kill="-" fi - mountinfo ${2:+--skip-point-regex} $2 ${3:+--node-regex} $3 ${4:+--fstype-regex} $4 ${5:+--skip-fstype-regex} $5 | \ - while read mnt; do + shift + mountinfo "$@" | while read mnt; do case "${cmd}" in umount*) # If we're using the mount (probably /usr) then don't unmount us -- cgit v1.2.3