1995-03-21 17:33:45 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1998-09-14 01:11:13 +02:00
|
|
|
# $Id:$
|
|
|
|
#
|
1995-03-21 17:33:45 +01:00
|
|
|
# make-localhost - edit the appropriate local information into
|
|
|
|
# /etc/namedb/localhost.rev
|
|
|
|
#
|
|
|
|
|
|
|
|
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 06:06:49 +02:00
|
|
|
date=`date +"%Y%m%d"`
|
1995-03-21 17:33:45 +01:00
|
|
|
|
|
|
|
mv -f localhost.rev localhost.rev.BAK 2>/dev/null
|
|
|
|
|
|
|
|
exec sed -e "s/@host@/$fullhost/g" \
|
|
|
|
-e "s/@domain@/$domain/g" \
|
|
|
|
-e "s/@date@/$date/g" \
|
|
|
|
< PROTO.localhost.rev > localhost.rev
|