improved enable-script

add basic disable-script (still not reinstall old binaries)
This commit is contained in:
jakob 2001-08-21 18:00:25 +00:00
parent dbbedce7d7
commit 1d31695dce
3 changed files with 80 additions and 15 deletions

View File

@ -0,0 +1,44 @@
#!/bin/sh
#
# $OpenBSD: bind9-disable,v 1.1 2001/08/21 18:00:25 jakob Exp $
#
# this script disables BIND v9 by removing links created by
# bind9-enable.
PREFIX=y0y0y0
BINDIR=/usr/sbin
if [ `id -u` -ne 0 ]; then
echo "You must be root to run this script."
exit
fi
echo "This script will remove BIND v9 links from $BINDIR"
echo ""
echo -n "Are you sure you want to to this (y/[n])? "
read answer
echo ""
if [ X$answer != Xy ]; then
echo "exit"
exit
fi
######################################################################
echo "Removing BIND v9 links:"
for link in \
dig host nslookup nsupdate \
named rndc lwresd \
dnssec-keygen dnssec-makekeyset dnssec-signkey dnssec-signzone \
named-checkconf named-checkzone
do
if [ -L $BINDIR/$link ]; then
echo " $link"
rm -f $BINDIR/$link
fi
done
echo ""
echo done.

View File

@ -1,13 +1,14 @@
#!/bin/sh
#
# $OpenBSD: bind9-enable,v 1.5 2001/02/12 17:15:53 brad Exp $
# $OpenBSD: bind9-enable,v 1.6 2001/08/21 18:00:25 jakob Exp $
#
# this script replaces OpenBSD named files with the corresponding
# files from BIND v9.
PREFIX=y0y0y0
BINDIR=/usr/sbin
config=/var/named/etc/named.conf
CHROOT=/var/named
config=${CHROOT}/etc/named.conf
if [ `id -u` -ne 0 ]; then
echo "You must be root to run this script."
@ -71,7 +72,8 @@ done
for file in \
named rndc lwresd \
dnssec-keygen dnssec-makekeyset dnssec-signkey dnssec-signzone
dnssec-keygen dnssec-makekeyset dnssec-signkey dnssec-signzone \
named-checkconf named-checkzone
do
echo " $BINDIR/$file -> $PREFIX/sbin/$file"
rm -f $BINDIR/$file
@ -84,19 +86,36 @@ echo done.
######################################################################
echo "Setup directory structure:"
if [ ! -d /var/named/var ]; then
echo " /var/named/var"
install -d -o root -g wheel -m 755 /var/named/var
if [ ! -d ${CHROOT} ]; then
echo " ${CHROOT}"
install -d -o root -g wheel -m 755 ${CHROOT}/var
fi
if [ ! -d /var/named/var/run ]; then
echo " /var/named/var/run"
install -d -o named -g wheel -m 755 /var/named/var/run
if [ ! -d ${CHROOT}/dev ]; then
echo " ${CHROOT}/dev"
install -d -o root -g wheel -m 755 ${CHROOT}/dev
fi
if [ ! -d /var/named/var/tmp ]; then
echo " /var/named/var/tmp"
install -d -o named -g wheel -m 755 /var/named/var/tmp
test -e ${CHROOT}/dev/null || mknod ${CHROOT}/dev/null c 2 2
test -e ${CHROOT}/dev/random || mknod ${CHROOT}/dev/random c 45 0
test -e ${CHROOT}/dev/srandom || mknod ${CHROOT}/dev/srandom c 45 1
test -e ${CHROOT}/dev/urandom || mknod ${CHROOT}/dev/urandom c 45 2
test -e ${CHROOT}/dev/prandom || mknod ${CHROOT}/dev/prandom c 45 3
test -e ${CHROOT}/dev/arandom || mknod ${CHROOT}/dev/arandom c 45 4
if [ ! -d ${CHROOT}/var ]; then
echo " ${CHROOT}/var"
install -d -o root -g wheel -m 755 ${CHROOT}/var
fi
if [ ! -d ${CHROOT}/var/run ]; then
echo " ${CHROOT}/var/run"
install -d -o named -g wheel -m 755 ${CHROOT}/var/run
fi
if [ ! -d ${CHROOT}/var/tmp ]; then
echo " ${CHROOT}/var/tmp"
install -d -o named -g wheel -m 755 ${CHROOT}/var/tmp
fi
echo ""

View File

@ -2,6 +2,8 @@ If you want to replace the OpenBSD named, use the following command:
${PREFIX}/sbin/bind9-enable
PLEASE NOTE that there is no bind9-disable command. Sample configuration
files can be found in ${PREFIX}/share/examples/bind9 and should be copied
to /var/named if used.
PLEASE NOTE that even there is a bind9-disable command, it will only remove
the links created in /usr/sbin - NOT reinstall the OpenBSD named.
Sample configuration files can be found in ${PREFIX}/share/examples/bind9
and should be copied to /var/named if used.