Deleted Added
full compact
special_hosts (270096) special_hosts (270892)
1#!/bin/sh
2#
1#!/bin/sh
2#
3# $FreeBSD: head/etc/autofs/special_hosts 270096 2014-08-17 09:44:42Z trasz $
3# $FreeBSD: stable/10/etc/autofs/special_hosts 270096 2014-08-17 09:44:42Z trasz $
4#
5
6if [ $# -eq 0 ]; then
7 out=`getent hosts`
8 [ $? -eq 0 ] || exit 1
9 echo "$out" | awk '{ print $2 }' | sort -u
10 exit 0
11fi
12
13out=`showmount -e "$1"`
14[ $? -eq 0 ] || exit 1
15echo "$out" | awk -v host="$1" \
16 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }'
17
4#
5
6if [ $# -eq 0 ]; then
7 out=`getent hosts`
8 [ $? -eq 0 ] || exit 1
9 echo "$out" | awk '{ print $2 }' | sort -u
10 exit 0
11fi
12
13out=`showmount -e "$1"`
14[ $? -eq 0 ] || exit 1
15echo "$out" | awk -v host="$1" \
16 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }'
17