From 6839b5fb0f75aec0846e98f02c772ca4c80ca0ab Mon Sep 17 00:00:00 2001 From: kn Date: Sun, 10 Feb 2019 21:11:43 +0000 Subject: Simplify NFS check Instead of getting all filesystems with df(1), filter /usr/share/ and check with mount(1) whether it's NFS, make df error out directly if the filesystem type matches nfs. OK sthen tb --- libexec/reorder_kernel/reorder_kernel.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libexec') diff --git a/libexec/reorder_kernel/reorder_kernel.sh b/libexec/reorder_kernel/reorder_kernel.sh index ee14f7a096c..d8b8a2d24a0 100644 --- a/libexec/reorder_kernel/reorder_kernel.sh +++ b/libexec/reorder_kernel/reorder_kernel.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: reorder_kernel.sh,v 1.5 2018/05/01 09:45:39 rpe Exp $ +# $OpenBSD: reorder_kernel.sh,v 1.6 2019/02/10 21:11:42 kn Exp $ # # Copyright (c) 2017 Robert Peichaer # @@ -21,8 +21,7 @@ set -o errexit export PATH=/bin:/sbin:/usr/bin:/usr/sbin # Skip if /usr/share is on a nfs mounted filesystem. -DISK_DEV=$(df /usr/share | sed '1d;s/ .*//') -[[ $(mount | grep "^$DISK_DEV") == *" type nfs "* ]] && exit 1 +df -t nfs /usr/share >/dev/null 2>&1 && exit 1 KERNEL=$(sysctl -n kern.osversion) KERNEL=${KERNEL%#*} -- cgit v1.2.3