18 lines
358 B
Plaintext
18 lines
358 B
Plaintext
|
#!/bin/sh
|
||
|
#
|
||
|
# $NetBSD: special_hosts,v 1.1 2018/01/09 03:31:14 christos Exp $
|
||
|
#
|
||
|
|
||
|
if [ $# -eq 0 ]; then
|
||
|
out=$(getent hosts)
|
||
|
[ $? -eq 0 ] || exit 1
|
||
|
echo "$out" | awk '{ print $2 }' | sort -u
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
out=$(showmount -E "$1")
|
||
|
[ $? -eq 0 ] || exit 1
|
||
|
echo "$out" | awk -v host="$1" \
|
||
|
'{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }'
|
||
|
|