[4049] | 1 | #!/bin/sh
|
---|
[4985] | 2 | #
|
---|
[4085] | 3 | # (c) Copyright 2002, 2003, 2005 Stichting Wireless Leiden, all
|
---|
[4049] | 4 | # rights reserved. More information can be found on
|
---|
| 5 | # http://wwww.wirelessleiden.nl and the license is at:
|
---|
| 6 | # http://wleiden.webweaving.org:8080/svn/node-config/LICENSE
|
---|
| 7 | #
|
---|
[4985] | 8 | # 1.00
|
---|
| 9 | # ?? Marten Vijn 24-03-03
|
---|
| 10 | # ?? new version 14-11-2003
|
---|
| 11 | # 1.03 proxy cleanup, detect faulty files, generalize
|
---|
| 12 | # file list, check node name to be valid, '-n' mode.
|
---|
| 13 | # make moving of final files a bit safer. (dirkx)
|
---|
[4990] | 14 | # 1.04 Add auto read-only detection. (dirkx)
|
---|
| 15 | # 1.05 Cope with WHOST containing a port number. (dirkx).
|
---|
[4997] | 16 | # 1.06 Better diff (dirkx)
|
---|
[5001] | 17 | # 1.07 Check versions of OS and Script
|
---|
[4985] | 18 | #
|
---|
[4049] | 19 | # If there is a global system configuration file, suck it in.
|
---|
| 20 | #
|
---|
[4050] | 21 |
|
---|
[4049] | 22 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
---|
| 23 | TMPDIR=${TMPDIR:-/tmp}
|
---|
| 24 | TMPPREFIX=${TMPDIR}/wl-tmp-$$
|
---|
[4050] | 25 | WHOST=${WHOST:-rambo.wleiden.net}
|
---|
[4985] | 26 | HTTP_PROXY_DEFAULT=${HTTP_PROXY:-http://proxy.wleiden.net:3128}
|
---|
[4049] | 27 | HTTP_USER_AGENT=${HTTP_USER_AGENT:-curl.faked.fetch/0.0}
|
---|
[5004] | 28 | VERSION=1.07
|
---|
[4052] | 29 | QUIET=${QUIET:-}
|
---|
[4985] | 30 | PRETEND=no
|
---|
[4986] | 31 | FORCE=no
|
---|
[4987] | 32 | CMD=do_move
|
---|
[5001] | 33 | DLV=no
|
---|
[4051] | 34 |
|
---|
[4987] | 35 | # Genesis master location.
|
---|
| 36 | link=${GENESIS:-http://${WHOST}/cgi-bin/g_list.pl/}
|
---|
| 37 | list=filelist
|
---|
| 38 |
|
---|
| 39 | # Location for private config
|
---|
| 40 | lcd=${LCDIR:-/lcd}
|
---|
| 41 | dir=${lcd}
|
---|
| 42 |
|
---|
[4985] | 43 | FETCH=${FETCH:-/usr/bin/fetch}
|
---|
| 44 | test -e ${FETCH} || FETCH="curl"
|
---|
[4051] | 45 |
|
---|
[4985] | 46 | if echo ${FETCH} | grep -q curl; then
|
---|
| 47 | FETCH="${FETCH} --silent"
|
---|
[4050] | 48 | else
|
---|
[4985] | 49 | FETCH="${FETCH} -q"
|
---|
[4050] | 50 | fi
|
---|
[4049] | 51 |
|
---|
[4985] | 52 | usage() {
|
---|
| 53 | echo Usage $0 [-q] [-p proxy] [-d] [-D] [-n] [hostname]
|
---|
| 54 | echo "-p <proxy> Set a proxy"
|
---|
| 55 | echo "-P Use ${HTTP_PROXY_DEFAULT} as a proxy"
|
---|
[4987] | 56 | echo "-D Use DHCP to get an address"
|
---|
[4985] | 57 | echo "-n Show what would happen - but do not do it"
|
---|
[4987] | 58 | echo "-d Diff met hudiige config (maar doe niets)"
|
---|
[4985] | 59 | echo "-q Suppress all output and user interaction"
|
---|
[4986] | 60 | echo "-F Force disk to write"
|
---|
[5001] | 61 | echo "-i Ignore all safety checks checks"
|
---|
[4985] | 62 | exit 1
|
---|
| 63 | }
|
---|
[4049] | 64 |
|
---|
[4985] | 65 | for i in $*
|
---|
| 66 | do
|
---|
| 67 | case "$i"
|
---|
| 68 | in
|
---|
[4987] | 69 | -D) connset || exit 1
|
---|
[4985] | 70 | ;;
|
---|
| 71 | -q)
|
---|
| 72 | QUIET=yes
|
---|
| 73 | ;;
|
---|
[5001] | 74 | -i)
|
---|
| 75 | DLV=
|
---|
| 76 | ;;
|
---|
[4987] | 77 | -d)
|
---|
[4988] | 78 | CMD=do_diff
|
---|
[4987] | 79 | dir=${TMPDIR}
|
---|
| 80 | ;;
|
---|
[4985] | 81 | -p)
|
---|
| 82 | shift;
|
---|
| 83 | HTTP_PROXY=$1
|
---|
| 84 | export HTTP_PROXY
|
---|
| 85 | ;;
|
---|
| 86 | -p)
|
---|
| 87 | HTTP_PROXY=HTTP_PROXY_DEFAULT
|
---|
| 88 | export HTTP_PROXY
|
---|
| 89 | ;;
|
---|
| 90 | -n)
|
---|
| 91 | PRETEND=yes
|
---|
| 92 | ;;
|
---|
[4986] | 93 | -F)
|
---|
| 94 | FORCE=yes
|
---|
| 95 | ;;
|
---|
[4985] | 96 | *)
|
---|
| 97 | test $# -eq 1 || usage
|
---|
| 98 | nodename=$i
|
---|
| 99 | break;
|
---|
| 100 | ;;
|
---|
| 101 | esac
|
---|
| 102 | shift
|
---|
| 103 | done
|
---|
[4049] | 104 |
|
---|
[4990] | 105 | HOST=`echo ${WHOST} | sed -e 's/:.*//'`
|
---|
[5001] | 106 | set `echo $VERSION | sed -e 's/\./ /'`
|
---|
| 107 | VERSION_MAJOR=$1
|
---|
| 108 | VERSION_MINOR=$2
|
---|
| 109 | VERSION_OTHER=$3
|
---|
[4986] | 110 |
|
---|
[4049] | 111 | # connection test function
|
---|
| 112 | connset()
|
---|
| 113 | {
|
---|
[4985] | 114 | if [ `ps ax | grep -c dhclient` != "1" ] ; then
|
---|
| 115 | killall dhclient
|
---|
| 116 | fi
|
---|
[4085] | 117 |
|
---|
[4985] | 118 | echo "Enter an IP address of a nearby Nameserver or use:"
|
---|
| 119 | echo " 1 to use COPE \(on Wleiden\)"
|
---|
| 120 | echo " 2 to use XS4All \(on the internet\)"
|
---|
| 121 | echo " 3 to use the LCP server \(on the internal LCP networ\)"
|
---|
[4049] | 122 |
|
---|
[4985] | 123 | echo -n "IP address or 1/2/3: "
|
---|
| 124 | read dns_list
|
---|
[4049] | 125 |
|
---|
[4985] | 126 | case $dns_list in
|
---|
| 127 | 1)
|
---|
| 128 | resolver="172.17.8.1"
|
---|
| 129 | ;;
|
---|
| 130 | 2)
|
---|
| 131 | resolver="194.109.9.99"
|
---|
| 132 | ;;
|
---|
| 133 | 3)
|
---|
| 134 | resolver="10.0.0.1"
|
---|
| 135 | ;;
|
---|
| 136 | *)
|
---|
| 137 | resolver=$dns_list
|
---|
| 138 | ;;
|
---|
| 139 | esac
|
---|
[4049] | 140 |
|
---|
[4985] | 141 | cp /etc/resolv.conf /etc/resolv.bak || exit 1
|
---|
| 142 | echo "nameserver ${resolver}" > /etc/resolv.conf
|
---|
[4049] | 143 |
|
---|
[4990] | 144 |
|
---|
[4985] | 145 | for nic in `ifconfig -l`
|
---|
| 146 | do
|
---|
| 147 | case ${nic} in
|
---|
| 148 | lo0 | wi*)
|
---|
| 149 | ;;
|
---|
| 150 | *)
|
---|
[4990] | 151 | if ping -qnoc ${HOST}; then
|
---|
| 152 | echo Connection on interface ${nic} to ${HOST} ok.
|
---|
[4985] | 153 | else
|
---|
| 154 | killall dhclient
|
---|
| 155 | echo Trying to get a DHCP lease on ${nic}
|
---|
| 156 | dhclient -1 ${nic}
|
---|
| 157 | fi
|
---|
| 158 | ;;
|
---|
| 159 | esac
|
---|
| 160 | done
|
---|
[4049] | 161 | }
|
---|
| 162 |
|
---|
| 163 | log()
|
---|
| 164 | {
|
---|
[4985] | 165 | if [ -z ${QUIET} ]; then
|
---|
| 166 | echo "$*"
|
---|
| 167 | fi
|
---|
[4049] | 168 | }
|
---|
[4985] | 169 | lognlr()
|
---|
| 170 | {
|
---|
| 171 | if [ -z ${QUIET} ]; then
|
---|
| 172 | echo -n "$*"
|
---|
| 173 | fi
|
---|
| 174 | }
|
---|
[4049] | 175 |
|
---|
| 176 | cleanse()
|
---|
| 177 | {
|
---|
[4985] | 178 | rm -f ${TMPPREFIX}.?
|
---|
[4049] | 179 | }
|
---|
| 180 |
|
---|
| 181 | # Normal exit; but make sure
|
---|
| 182 | # we also clean up any tmp files
|
---|
| 183 | #
|
---|
| 184 | cleanexit()
|
---|
| 185 | {
|
---|
[4985] | 186 | E=1
|
---|
| 187 | if [ $# -gt 0 ]; then
|
---|
| 188 | E=$1
|
---|
| 189 | fi
|
---|
| 190 | cleanse
|
---|
| 191 | log Exit
|
---|
| 192 | exit $E
|
---|
| 193 | # Trap any weird exit codes.
|
---|
| 194 | exit 1
|
---|
[4049] | 195 | }
|
---|
| 196 |
|
---|
| 197 | safefetch()
|
---|
| 198 | {
|
---|
[4985] | 199 | url=$1
|
---|
| 200 | file=$2
|
---|
[5003] | 201 | ${FETCH} -o - ${url} > ${TMPPREFIX}.x \
|
---|
[4985] | 202 | || cleanexit 1
|
---|
[4049] | 203 |
|
---|
[4985] | 204 | # Genesis can provide us with corrupted/empty files
|
---|
| 205 | # with a 200 OK - so insist that they are at least
|
---|
| 206 | # a few lines long.
|
---|
| 207 | #
|
---|
| 208 | set `wc -l ${TMPPREFIX}.x`
|
---|
| 209 | if [ $1 -lt 2 ]; then
|
---|
| 210 | echo File ${link}${nodename} is less than 2 lines long.
|
---|
| 211 | echo Assuming a problem with Genesis.
|
---|
| 212 | cleanexit 2
|
---|
| 213 | fi
|
---|
| 214 |
|
---|
[5003] | 215 | cp ${TMPPREFIX}.x ${file} \
|
---|
[4985] | 216 | || cleanexit 1
|
---|
| 217 | rm -f ${TMPPREFIX}.x
|
---|
| 218 |
|
---|
| 219 | return 0
|
---|
[4049] | 220 | }
|
---|
| 221 |
|
---|
[4985] | 222 | getvalidnodenames()
|
---|
| 223 | {
|
---|
| 224 | log Fetching list of nodes from ${link}
|
---|
[5003] | 225 | safefetch ${link} ${nlist} || cleanexit 1
|
---|
[4985] | 226 | }
|
---|
| 227 |
|
---|
[4049] | 228 | getvalidnodename()
|
---|
| 229 | {
|
---|
| 230 | while ! grep -q "^${nodename}\$" ${nlist}
|
---|
| 231 | do
|
---|
[4085] | 232 | echo Nodes:
|
---|
[4985] | 233 | if [ -x /usr/bin/column ]; then
|
---|
| 234 | column ${nlist}
|
---|
| 235 | else
|
---|
| 236 | cat ${nlist}
|
---|
| 237 | fi
|
---|
[4085] | 238 | echo
|
---|
| 239 | echo -n enter nodename \[default: ${default}\]:
|
---|
| 240 | if [ -z ${QUIET} ]; then
|
---|
| 241 | read nodename
|
---|
| 242 | else
|
---|
| 243 | nodename=${default}
|
---|
| 244 | fi
|
---|
[4049] | 245 |
|
---|
[4085] | 246 | if [ "x${nodename}" = "x" ]; then
|
---|
| 247 | nodename=${default}
|
---|
| 248 | fi
|
---|
[4049] | 249 | done
|
---|
| 250 |
|
---|
| 251 | echo Node Selected: ${nodename}
|
---|
| 252 | }
|
---|
| 253 |
|
---|
| 254 |
|
---|
| 255 | do_diff() {
|
---|
[4997] | 256 | if test -e $lcd/$1; then
|
---|
[5003] | 257 | diff -uwbB $lcd/$1 $dir/$1.new
|
---|
[4990] | 258 | else
|
---|
[5001] | 259 | echo Warning: $lcd/$1 does not yet exist - no DIFF
|
---|
[4990] | 260 | fi
|
---|
[4049] | 261 | }
|
---|
| 262 |
|
---|
| 263 | do_move() {
|
---|
[5003] | 264 | if [ -e $dir/$1 ]; then
|
---|
| 265 | mv $dir/$1 $dir/$1.bak || cleanexit 1
|
---|
| 266 | fi
|
---|
| 267 | cp $dir/$1.new $dir/$1 || cleanexit 1
|
---|
| 268 | rm $dir/$1.new || cleanexit 1
|
---|
[4985] | 269 | }
|
---|
[4049] | 270 |
|
---|
[4985] | 271 | linkin() {
|
---|
| 272 | symdir=$1
|
---|
| 273 | file=$2
|
---|
[4054] | 274 |
|
---|
[4985] | 275 | if [ ${PRETEND} = 'yes' ]; then
|
---|
| 276 | echo "** $CMD $*"
|
---|
| 277 | else
|
---|
[5003] | 278 | $CMD $file || exit 1
|
---|
[4985] | 279 | fi
|
---|
[4049] | 280 |
|
---|
[4986] | 281 | test -e $symdir/$file || (
|
---|
| 282 | echo WARNING: Symlink $symdir/$file not in place.
|
---|
| 283 | echo use: ln -s $dir/$file $symdir/$file
|
---|
| 284 | echo to fix if appropriate.
|
---|
| 285 | )
|
---|
[4049] | 286 | }
|
---|
| 287 |
|
---|
[4988] | 288 | log Config Node -- Version: $VERSION '$Rev: 5004 $'
|
---|
[4049] | 289 |
|
---|
[4988] | 290 | # Make sure we clean up our mess when needed.
|
---|
| 291 | trap "rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3
|
---|
[4049] | 292 |
|
---|
[5003] | 293 | if [ ${PRETEND} != 'yes' -a ${CMD} != 'do_diff' ]; then
|
---|
[4988] | 294 | if mount | grep "on / " | grep -q read-only; then
|
---|
| 295 | if [ ${FORCE} = "yes" ]; then
|
---|
| 296 | echo Forcing read-only disk into rw.
|
---|
| 297 | fsck / || exit 2
|
---|
| 298 | mount -o noatime -u -w / || exit 2 || exit 1
|
---|
| 299 | trap "mount -u -r /; rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3
|
---|
| 300 | FORCE=rw
|
---|
| 301 | else
|
---|
| 302 | echo ERROR - disk / is mounted read only. Aborting.
|
---|
| 303 | exit 1
|
---|
| 304 | fi
|
---|
| 305 | fi
|
---|
| 306 | fi
|
---|
| 307 |
|
---|
| 308 | export HTTP_USER_AGENT
|
---|
| 309 | export TMPDIR
|
---|
| 310 |
|
---|
| 311 |
|
---|
[4049] | 312 | #check config dir
|
---|
| 313 | #
|
---|
| 314 | if [ ! -d ${dir} ]; then
|
---|
[4085] | 315 | mkdir -p ${dir} || cleanexit 1
|
---|
[4049] | 316 | fi
|
---|
| 317 |
|
---|
| 318 | if [ -z ${HTTP_PROXY} ]; then
|
---|
[4990] | 319 | (
|
---|
| 320 | log Checking DNS for ${HOST}
|
---|
| 321 | host ${HOST} > /dev/null || exit 1
|
---|
| 322 | log Checking if ${HOST} can be reached
|
---|
| 323 | ping -qnoc 1 ${HOST} > /dev/null || exit 1
|
---|
[5003] | 324 | log Connection: Ok
|
---|
[4990] | 325 | exit 0
|
---|
| 326 | ) || connset
|
---|
| 327 | else
|
---|
| 328 | log Connection not checked because there is an http proxy configured: ${HTTP_PROXY}.
|
---|
[4049] | 329 | fi
|
---|
| 330 |
|
---|
[4985] | 331 | if [ -r ${lcd}/myname ]; then
|
---|
| 332 | default=`cat ${lcd}/myname`
|
---|
[4049] | 333 | else
|
---|
[4085] | 334 | default=`hostname -s`
|
---|
| 335 | test -z $default && default=none
|
---|
[4049] | 336 | fi
|
---|
| 337 |
|
---|
[4989] | 338 | if [ ! -z ${QUIET} ]; then
|
---|
| 339 | if [ -z ${nodename} ]; then
|
---|
| 340 | nodename=${default}
|
---|
| 341 | fi
|
---|
[4988] | 342 | fi
|
---|
| 343 |
|
---|
[4989] | 344 |
|
---|
[4049] | 345 | nlist=${TMPPREFIX}.l
|
---|
| 346 |
|
---|
| 347 | test -z $default && default=$nodename
|
---|
| 348 |
|
---|
[4985] | 349 | getvalidnodenames || exit 1
|
---|
| 350 |
|
---|
[4049] | 351 | test -z $nodename && getvalidnodename
|
---|
| 352 |
|
---|
[4985] | 353 | while test -z $nodename || ! grep -q ${nodename} ${nlist}
|
---|
| 354 | do
|
---|
| 355 | echo
|
---|
| 356 | echo Error: Node named \"$nodename\" not known.
|
---|
| 357 | if [ -z ${QUIET} ]; then
|
---|
| 358 | exit 1
|
---|
| 359 | fi
|
---|
| 360 | echo Please select one from the list.
|
---|
| 361 | echo
|
---|
| 362 | getvalidnodename
|
---|
| 363 | done
|
---|
| 364 |
|
---|
[5003] | 365 | lognlr "Checking release and OS versions: "
|
---|
[5001] | 366 |
|
---|
[5003] | 367 | safefetch ${link}${nodename}/info $dir/info.last \
|
---|
[5001] | 368 | || cleanexit 1
|
---|
| 369 |
|
---|
| 370 | OS=`uname -s`
|
---|
| 371 | REL=`uname -r`
|
---|
[5003] | 372 | set -- `head -1 $dir/info.last`
|
---|
| 373 |
|
---|
[5001] | 374 | # FreeBSD 5.0-RELEASE 1 YES
|
---|
| 375 | if [ $# != 4 ]; then
|
---|
| 376 | echo Info verification failed.
|
---|
| 377 | cleanexit 1
|
---|
| 378 | fi
|
---|
[5003] | 379 | if [ x$4 != 'xYES' ]; then
|
---|
[5001] | 380 | echo Genesis marked as disabled for this machine.
|
---|
| 381 | test -z ${DLV} || cleanexit 1
|
---|
| 382 | fi
|
---|
[5003] | 383 | if [ 0$3 -ne $VERSION_MAJOR ]; then
|
---|
[5001] | 384 | echo This script is version $VERSION, genesis info is for version $3.xx
|
---|
| 385 | test -z ${DLV} || cleanexit 1
|
---|
| 386 | fi
|
---|
[5003] | 387 | if [ x$1 != x$OS ]; then
|
---|
[5001] | 388 | echo Operating system mismatch; this machine: $OS, but config is for $1
|
---|
| 389 | test -z ${DLV} || cleanexit 1
|
---|
| 390 | fi
|
---|
[5003] | 391 | if [ x$2 != x$REL ]; then
|
---|
[5001] | 392 | echo This machine runs $REL, but the configuration is for $2
|
---|
| 393 | test -z ${DLV} || cleanexit 2
|
---|
| 394 | fi
|
---|
| 395 |
|
---|
[5003] | 396 | log Ok
|
---|
| 397 |
|
---|
[4049] | 398 | log Fetching file list from $link for $nodename
|
---|
| 399 |
|
---|
| 400 | safefetch ${link}${nodename} ${dir}/${list}
|
---|
| 401 |
|
---|
[4985] | 402 | lognlr "Fetching:"
|
---|
[4049] | 403 | for i in `cat ${dir}/${list}`
|
---|
| 404 | do
|
---|
[4985] | 405 | lognlr " ${i}"
|
---|
[5003] | 406 | # $FETCH -o - ${link}${nodename}/${i} > ${dir}/${i}.new || cleanexit 1
|
---|
| 407 | safefetch ${link}${nodename}/${i} ${dir}/${i}.new
|
---|
[4049] | 408 | done
|
---|
[4985] | 409 | log .
|
---|
[4049] | 410 |
|
---|
| 411 | for i in `cat ${dir}/${list}`
|
---|
| 412 | do
|
---|
[4985] | 413 | case ${i} in
|
---|
| 414 | linux.sh | config | txtconfig )
|
---|
| 415 | # log obsolete file: ${i} - skipped
|
---|
| 416 | ;;
|
---|
| 417 | resolv.conf | rc.node.local | rc.local)
|
---|
[4986] | 418 | linkin /etc ${i}
|
---|
[4985] | 419 | ;;
|
---|
| 420 | snmpd.local.conf)
|
---|
[4986] | 421 | linkin /usr/local/share/snmp ${i}
|
---|
[4985] | 422 | ;;
|
---|
| 423 | named.conf)
|
---|
[4986] | 424 | linkin /etc/namedb ${i}
|
---|
[4985] | 425 | ;;
|
---|
| 426 | dhcpd.conf)
|
---|
[4986] | 427 | linkin /usr/local/etc ${i}
|
---|
[4985] | 428 | ;;
|
---|
| 429 | zebra.conf | ospfd.conf)
|
---|
[4986] | 430 | linkin /usr/local/etc/zebra ${i}
|
---|
[4985] | 431 | ;;
|
---|
| 432 | authorized_keys)
|
---|
| 433 | linkin /root/.ssh ${i}
|
---|
| 434 | ;;
|
---|
| 435 | ssh_known_hosts)
|
---|
| 436 | linkin /etc/ssh ${i}
|
---|
| 437 | ;;
|
---|
| 438 | daemons.sh)
|
---|
| 439 | linkin /wl ${i}
|
---|
| 440 | ;;
|
---|
| 441 | *)
|
---|
| 442 | echo Script cannot cope with ${i} - ignoring..
|
---|
| 443 | ;;
|
---|
| 444 | esac
|
---|
[4049] | 445 | done
|
---|
| 446 |
|
---|
| 447 | if [ -e /etc/rc.local ]; then
|
---|
[4085] | 448 | # See if we are in rc.local
|
---|
| 449 | if grep -q /config-node.sh /etc/rc.local; then
|
---|
[4049] | 450 |
|
---|
[4085] | 451 | echo As this node now has real configs - do enter a root password
|
---|
| 452 | echo
|
---|
| 453 | passwd \
|
---|
| 454 | || cleanexit 1
|
---|
[4049] | 455 |
|
---|
[4085] | 456 | echo Removing /etc/rc.local
|
---|
| 457 | rm -f /etc/rc.local
|
---|
| 458 |
|
---|
| 459 | echo Will drop write perms on the next reboot.
|
---|
| 460 | fi
|
---|
[4049] | 461 | fi
|
---|
| 462 |
|
---|
| 463 | # Record our name.
|
---|
| 464 | echo ${nodename} > ${dir}/myname
|
---|
| 465 |
|
---|
| 466 | # Rebuild reverse lookups
|
---|
[4985] | 467 | if test -e /etc/rc.node.local; then
|
---|
| 468 | H=`cat /etc/rc.node.local | grep hostname | sed -e s/hostname=// | sed -e s/[\"\']//g`
|
---|
| 469 | hostname $H
|
---|
| 470 | else
|
---|
| 471 | echo Warning: rc.node.local missing.
|
---|
| 472 | fi
|
---|
| 473 |
|
---|
[5003] | 474 | if [ -r /etc/namedb/make-localhost -a ${CMD} != 'do_diff' ]; then
|
---|
[4085] | 475 | (
|
---|
| 476 | cd /etc/namedb || exit 1
|
---|
| 477 | sh /etc/namedb/make-localhost || exit 1
|
---|
| 478 | ) || exit 1
|
---|
[4049] | 479 | fi
|
---|
| 480 |
|
---|
[4985] | 481 | cleanse || exit 1
|
---|
[4049] | 482 |
|
---|
| 483 | if [ -e /etc/rc.empty.conf ] ; then
|
---|
[4985] | 484 | rm /etc/rc.empty.conf || exit 1
|
---|
| 485 | echo removed /etc/rc.empty.conf - and rebooting in 30 seconds \(or press ctrl-C to abort\)
|
---|
| 486 | read -t 30 DUMMY
|
---|
| 487 | reboot
|
---|
[4049] | 488 | fi
|
---|
| 489 |
|
---|
[4986] | 490 | test ${FORCE} = 'rw' && mount -u -r /
|
---|
[4049] | 491 | exit 0
|
---|