mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
1440dc3c88
Delete bogus localhost.rev. Add prototype localhost.rev and a script to create it automatically. (NB to installl people: you should ask ``do you have a full-time connection o the Internet?'', run this script, and enable named if the answer is yes.)
36 lines
695 B
Bash
Executable File
36 lines
695 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# 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
|
|
|
|
date=`date +"%y%m%d"`
|
|
|
|
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
|