home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sberbank.sumy.ua
/
2014.11.ftp.sberbank.sumy.ua.tar
/
ftp.sberbank.sumy.ua
/
incoming
/
sxtech
/
etc
/
namedb
/
make-localhost
next >
Wrap
Text File
|
2014-08-29
|
1KB
|
48 lines
#!/bin/sh
#
# $FreeBSD: src/etc/namedb/make-localhost,v 1.4.2.2 2002/02/04 18:24:21 ume Exp $
#
# make-localhost - edit the appropriate local information into
# /etc/namedb/localhost.rev
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
export PATH
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-v6.rev localhost-v6.rev.BAK 2>/dev/null
sed -e "s/@host@/$fullhost/g" \
-e "s/@domain@/$domain/g" \
-e "s/@date@/$date/g" \
< PROTO.localhost-v6.rev > localhost-v6.rev
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