NetBSD/share/sushi/network/exports/addexport/script3

14 lines
397 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script3,v 1.1 2001/04/25 03:43:27 garbled Exp $
MAPROOT=`grep "$1 " /etc/exports | grep -- '-maproot'`
if [ $? != 0 ]; then
cut -f 1 -d ':' /etc/passwd
else
MAPROOT=`echo $MAPROOT | sed -e 's/.*-maproot=\(.*\) *.*/\1/'`
USER=`echo $MAPROOT | cut -f 1 -d ':'`
USER=`id -p $USER | grep uid | awk '{print $2}'`
echo $USER
cut -f 1 -d ':' /etc/passwd | grep -v "$USER$"
fi