1995-03-21 16:33:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1998-09-13 23:11:13 +00:00
|
|
|
#
|
1995-03-21 16:33:45 +00:00
|
|
|
# make-localhost - edit the appropriate local information into
|
|
|
|
# /etc/namedb/localhost.rev
|
|
|
|
#
|
|
|
|
|
2000-11-29 19:19:06 +00:00
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
|
|
|
|
export PATH
|
|
|
|
|
1995-03-21 16:33:45 +00:00
|
|
|
if [ "`hostname -s`" != "`hostname`" ]; then
|
|
|
|
# hostname must contain domain
|
|
|
|
|
|
|
|
host=`hostname -s`
|
|
|
|
fullhost=`hostname`
|
|
|
|
domain=`echo $fullhost | sed "s/^$host\.//"`
|
|
|
|
else
|
|
|
|
host=`hostname`
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo -n 'Enter your domain name: '
|
|
|
|
read domain
|
|
|
|
else
|
|
|
|
domain="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# strip trailing dot, if any
|
|
|
|
domain=`echo $domain | sed 's/\.$//'`
|
|
|
|
fullhost="$host.$domain"
|
|
|
|
fi
|
|
|
|
|
1997-08-11 04:06:49 +00:00
|
|
|
date=`date +"%Y%m%d"`
|
1995-03-21 16:33:45 +00:00
|
|
|
|
2004-09-28 09:46:00 +00:00
|
|
|
mkdir -p master
|
|
|
|
|
|
|
|
mv -f master/localhost-v6.rev master/localhost-v6.rev.BAK 2>/dev/null
|
2002-01-22 17:22:41 +00:00
|
|
|
|
|
|
|
sed -e "s/@host@/$fullhost/g" \
|
|
|
|
-e "s/@domain@/$domain/g" \
|
|
|
|
-e "s/@date@/$date/g" \
|
2004-09-28 09:46:00 +00:00
|
|
|
< PROTO.localhost-v6.rev > master/localhost-v6.rev
|
2002-01-22 17:22:41 +00:00
|
|
|
|
2004-09-28 09:46:00 +00:00
|
|
|
mv -f master/localhost.rev master/localhost.rev.BAK 2>/dev/null
|
1995-03-21 16:33:45 +00:00
|
|
|
|
|
|
|
exec sed -e "s/@host@/$fullhost/g" \
|
|
|
|
-e "s/@domain@/$domain/g" \
|
|
|
|
-e "s/@date@/$date/g" \
|
2004-09-28 09:46:00 +00:00
|
|
|
< PROTO.localhost.rev > master/localhost.rev
|