diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-28 16:02:50 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-28 16:02:50 -0700 |
commit | 8cc248d3d90d606e87adb412049b318dba687487 (patch) | |
tree | ff30306478b283bad209980b999833051760b0fd /etc | |
parent | 97d93e0ff2b196aecdf71dc60468b7c38c06fef4 (diff) | |
download | vyatta-cfg-8cc248d3d90d606e87adb412049b318dba687487.tar.gz vyatta-cfg-8cc248d3d90d606e87adb412049b318dba687487.zip |
Avoid updating config.boot unless necessary
On normal boot, no changes to config.boot or modes are
needed.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/init.d/vyatta-ofr | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 45333ac..a3dbc42 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -82,18 +82,22 @@ init_bootfile () { CURTIME=$(date +%F-%H%M%S) mv $BOOTFILE $BOOTFILE.pre-glendale.$CURTIME fi - if [ ! -f $BOOTFILE ] ; then + if [ ! -r $BOOTFILE ] ; then if [ -f $vyatta_sysconfdir/config.boot.default ]; then cp $vyatta_sysconfdir/config.boot.default $BOOTFILE else $vyatta_sbindir/vyatta_current_conf_ver.pl > $BOOTFILE fi + + chgrp ${GROUP} $BOOTFILE + chmod 660 $BOOTFILE + fi + + if grep -q -x 'rtrmgr {' $BOOTFILE ; then + ## remove the unnecessary and potentially conflicting + ## config-directory statement (i.e. /mnt/floppy vs. /media/floppy) + sed -i '/^rtrmgr {$/,/^}$/d' $BOOTFILE fi - chgrp ${GROUP} $BOOTFILE - chmod 660 $BOOTFILE - ## remove the unnecessary and potentially conflicting - ## config-directory statement (i.e. /mnt/floppy vs. /media/floppy - sed -i '/^rtrmgr {$/,/^}$/d' $BOOTFILE } # if necessary, migrate initial config |