Changeset 4986 in genesis for tools/config-node.sh
- Timestamp:
- Nov 2, 2005, 5:43:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/config-node.sh
-
Property svn:keywords
set to
Id Rev
r4985 r4986 12 12 # file list, check node name to be valid, '-n' mode. 13 13 # make moving of final files a bit safer. (dirkx) 14 # 1.04 Add auto read-only detection. 14 15 # 15 16 # If there is a global system configuration file, suck it in. … … 22 23 HTTP_PROXY_DEFAULT=${HTTP_PROXY:-http://proxy.wleiden.net:3128} 23 24 HTTP_USER_AGENT=${HTTP_USER_AGENT:-curl.faked.fetch/0.0} 24 VERSION=1.0 325 VERSION=1.04 25 26 QUIET=${QUIET:-} 26 27 PRETEND=no 28 FORCE=no 27 29 28 30 FETCH=${FETCH:-/usr/bin/fetch} … … 42 44 echo "-n Show what would happen - but do not do it" 43 45 echo "-q Suppress all output and user interaction" 46 echo "-F Force disk to write" 44 47 exit 1 45 48 } … … 66 69 PRETEND=yes 67 70 ;; 71 -F) 72 FORCE=yes 73 ;; 68 74 *) 69 75 test $# -eq 1 || usage … … 75 81 done 76 82 83 echo Config Node -- Version: $VERSION '$Rev$' 84 85 # Make sure we clean up our mess when needed. 86 trap "rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3 87 88 if [ ${PRETEND} != 'yes' ]; then 89 if mount | grep "on / " | grep -q read-only; then 90 if [ ${FORCE} = "yes" ]; then 91 echo Forcing read-only disk into rw. 92 fsck / || exit 2 93 mount -o noatime -u -w / || exit 2 || exit 1 94 trap "mount -u -r /; rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3 95 FORCE=rw 96 else 97 echo ERROR - disk / is mounted read only. Aborting. 98 exit 1 99 fi 100 fi 101 fi 102 77 103 export HTTP_USER_AGENT 78 104 export TMPDIR … … 85 111 lcd=${LCDIR:-/lcd} 86 112 87 # Make sure we clean up our mess when needed.88 trap "rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 389 113 90 114 # connection test function … … 253 277 fi 254 278 255 test -e $symdir/$file || echo WARNING: Symlink $symdir/$file not in place. 279 test -e $symdir/$file || ( 280 echo WARNING: Symlink $symdir/$file not in place. 281 echo use: ln -s $dir/$file $symdir/$file 282 echo to fix if appropriate. 283 ) 256 284 } 257 285 258 286 dir=${lcd} 259 287 260 echo Config Node -- Version: $VERSION261 288 262 289 #check config dir … … 331 358 ;; 332 359 resolv.conf | rc.node.local | rc.local) 333 linkin /etc /${i}360 linkin /etc ${i} 334 361 ;; 335 362 snmpd.local.conf) 336 linkin /usr/local/share/snmp /${i}363 linkin /usr/local/share/snmp ${i} 337 364 ;; 338 365 named.conf) 339 linkin /etc/namedb/${i}366 linkin /etc/namedb ${i} 340 367 ;; 341 368 dhcpd.conf) 342 linkin /usr/local/etc /${i}369 linkin /usr/local/etc ${i} 343 370 ;; 344 371 zebra.conf | ospfd.conf) 345 linkin /usr/local/etc/zebra /${i}372 linkin /usr/local/etc/zebra ${i} 346 373 ;; 347 374 authorized_keys) … … 403 430 fi 404 431 432 test ${FORCE} = 'rw' && mount -u -r / 405 433 exit 0 -
Property svn:keywords
set to
Note:
See TracChangeset
for help on using the changeset viewer.