diff options
-rw-r--r-- | debian/control | 4 | ||||
-rwxr-xr-x | etc/init.d/vyatta-ofr | 5 | ||||
-rwxr-xr-x | scripts/VyattaConfigLoad.pm | 3 | ||||
-rwxr-xr-x | scripts/vyatta-load-config.pl | 18 |
4 files changed, 28 insertions, 2 deletions
diff --git a/debian/control b/debian/control index 66c0ab8..5a06588 100644 --- a/debian/control +++ b/debian/control @@ -10,10 +10,10 @@ Architecture: any Depends: sed (>= 4.1.5), perl (>= 5.8.8), procps (>= 1:3.2.7-3), - vyatta-quagga | quagga, coreutils (>= 5.97-5.3), + vyatta-bash | bash (>= 3.1), + vyatta-quagga | quagga, vyatta-op, - vyatta-bash, vyatta-config-migrate, dhcp3-client | vyatta-dhcp3-client, bsdutils (>=1:2.13), 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/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index 9605017..c4ce8bd 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -30,6 +30,8 @@ use VyattaConfig; my $default_rank = 0; my %config_rank = ( 'qos-policy' => 110, + 'firewall' => 102, + 'service nat' => 101, 'interfaces' => 100, 'interfaces bridge' => 99, 'interfaces ethernet' => 98, @@ -38,6 +40,7 @@ my %config_rank = ( 'protocols static' => 85, 'service ssh' => 84, 'service telnet' => 83, + 'vpn' => 80, ); my @all_nodes = (); diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index f845c24..9513ffa 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -43,6 +43,24 @@ if (defined($ARGV[0])) { } } +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"); |