Home | History | Annotate | Line # | Download | only in autofs
special_hosts revision 1.1
      1  1.1  christos #!/bin/sh
      2  1.1  christos #
      3  1.1  christos # $NetBSD: special_hosts,v 1.1 2018/01/09 03:31:14 christos Exp $
      4  1.1  christos #
      5  1.1  christos 
      6  1.1  christos if [ $# -eq 0 ]; then
      7  1.1  christos 	out=$(getent hosts)
      8  1.1  christos 	[ $? -eq 0 ] || exit 1
      9  1.1  christos 	echo "$out" | awk '{ print $2 }' | sort -u
     10  1.1  christos 	exit 0
     11  1.1  christos fi
     12  1.1  christos 
     13  1.1  christos out=$(showmount -E "$1")
     14  1.1  christos [ $? -eq 0 ] || exit 1
     15  1.1  christos echo "$out" | awk -v host="$1" \
     16  1.1  christos     '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }'
     17  1.1  christos 
     18