1998-07-31 08:47:16 +00:00
|
|
|
# $Id: ndcedit.awk,v 1.7 1998/05/03 05:14:04 peter Exp $
|
1996-08-29 21:46:46 +00:00
|
|
|
NR == 3 {
|
1996-11-04 23:57:40 +00:00
|
|
|
print "#"
|
|
|
|
print "# This file is generated automatically, do not edit it here!"
|
|
|
|
print "# Please change src/usr.sbin/ndc/ndcedit.awk instead"
|
|
|
|
print "#"
|
|
|
|
print ""
|
|
|
|
|
1996-08-29 21:46:46 +00:00
|
|
|
print "# If there is a global system configuration file, suck it in."
|
1997-05-27 07:19:57 +00:00
|
|
|
print "if [ -f /etc/rc.conf ]; then"
|
|
|
|
print "\t. /etc/rc.conf"
|
1996-08-29 21:46:46 +00:00
|
|
|
print "fi\n"
|
|
|
|
}
|
|
|
|
{
|
|
|
|
if ($1 == "named") {
|
1997-06-18 01:55:19 +00:00
|
|
|
printf "\t\t# $named_flags is imported from /etc/rc.conf\n"
|
|
|
|
printf "\t\tif [ \"X${named_enable}\" = X\"YES\" ]; then\n"
|
1998-07-31 08:47:16 +00:00
|
|
|
printf "\t\t\t${named_program} ${named_flags} && {\n"
|
1996-08-29 21:46:46 +00:00
|
|
|
getline
|
|
|
|
printf "\t%s\n", $0
|
|
|
|
getline
|
|
|
|
printf "\t%s\n", $0
|
|
|
|
getline
|
|
|
|
printf "\t%s\n", $0
|
|
|
|
printf "\t\tfi\n"
|
1998-05-03 05:14:04 +00:00
|
|
|
} else if (/PS=`/) {
|
|
|
|
printf "\tif [ -f /proc/$PID/status ]; then\n"
|
|
|
|
printf "\t\tPS=`cat /proc/$PID/status 2>/dev/null | grep named`\n"
|
|
|
|
printf "\telse\n"
|
|
|
|
gsub("\t", "\t\t", $0);
|
|
|
|
print;
|
|
|
|
printf "\tfi\n"
|
1996-08-29 21:46:46 +00:00
|
|
|
} else {
|
1996-11-04 23:57:40 +00:00
|
|
|
if (/PATH=/) {
|
|
|
|
gsub(":/usr/ucb:", ":", $0);
|
|
|
|
}
|
1996-08-29 21:46:46 +00:00
|
|
|
print;
|
|
|
|
}
|
|
|
|
}
|