summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2008-03-26 12:32:24 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2008-03-26 12:32:24 -0700
commit76aae0216871f8c4f3b1c2ebad6761e67ee3e799 (patch)
treedc72732c1de11539623e71a9c81fc4ef58d87b89
parentdedc3083522c70de84db4d2e7bef21998debd18f (diff)
downloadvyatta-cfg-76aae0216871f8c4f3b1c2ebad6761e67ee3e799.tar.gz
vyatta-cfg-76aae0216871f8c4f3b1c2ebad6761e67ee3e799.zip
fix for bug 3032:
* rename pre-glendale start-up config. * warn user when loading a pre-glendale config.
-rwxr-xr-xetc/init.d/vyatta-ofr5
-rwxr-xr-xscripts/vyatta-load-config.pl18
2 files changed, 23 insertions, 0 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr
index b1e7a69..776aaf4 100755
--- a/etc/init.d/vyatta-ofr
+++ b/etc/init.d/vyatta-ofr
@@ -66,6 +66,11 @@ have_rl_system () {
# if necessary, provide initial config
init_bootfile () {
+ if [ -f $BOOTFILE ] && grep -q '/\*XORP Configuration File, v1.0\*/' \
+ $BOOTFILE >&/dev/null; then
+ CURTIME=$(date +%F-%H%M%S)
+ mv $BOOTFILE $BOOTFILE.pre-glendale.$CURTIME
+ fi
if [ ! -f $BOOTFILE ] ; then
if [ -f $vyatta_sysconfdir/config.boot.default ]; then
cp $vyatta_sysconfdir/config.boot.default $BOOTFILE
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index a432d8c..05323e3 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -40,6 +40,24 @@ if (!($load_file =~ /^\//)) {
$load_file = "$bootpath/$load_file";
}
+if (!open(CFG, "<$load_file")) {
+ print "Cannot open configuration file $load_file\n";
+ exit 1;
+}
+while (<CFG>) {
+ if (/\/\*XORP Configuration File, v1.0\*\//) {
+ print "Warning: Loading a pre-Glendale configuration.\n";
+ print "Do you want to continue? [no] ";
+ my $resp = <STDIN>;
+ if (!($resp =~ /^yes$/i)) {
+ print "Configuration not loaded\n";
+ exit 1;
+ }
+ last;
+ }
+}
+close CFG;
+
# do config migration
system("$sbindir/vyatta_config_migrate.pl $load_file");