From 50ee96499609f9bd229e6d06a7ce57a17e9e4c52 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 20 Mar 2008 10:18:39 -0700 Subject: fix for bug 3037: shell completion --- etc/bash_completion.d/20vyatta-cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 4ad86ce..7968cec 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -440,7 +440,8 @@ vyatta_parse_tmpl () vyatta_cfg_comp_help=$(vyatta_parse_tmpl_comp_fields $1 "comp_help") if (( ${#vyatta_cfg_allowed[@]} == 0 )); then - local -a ares=( $(eval "$acmd") ) + astr=$(eval "$acmd") + eval "ares=( $astr )" for (( i=0 ; i<${#ares[@]} ; i++ )); do if [[ "${ares[i]}" != \<*\> ]]; then vyatta_cfg_allowed+=( "${ares[i]}" ) -- cgit v1.2.3 From a1a664266381ee6290f22213dc415960ec24b267 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 20 Mar 2008 18:25:42 -0700 Subject: handle <> completion correctly --- etc/bash_completion.d/20vyatta-cfg | 2 ++ 1 file changed, 2 insertions(+) (limited to 'etc') diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 7968cec..f979939 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -441,6 +441,8 @@ vyatta_parse_tmpl () if (( ${#vyatta_cfg_allowed[@]} == 0 )); then astr=$(eval "$acmd") + astr=${astr///\\>} eval "ares=( $astr )" for (( i=0 ; i<${#ares[@]} ; i++ )); do if [[ "${ares[i]}" != \<*\> ]]; then -- cgit v1.2.3 From 76aae0216871f8c4f3b1c2ebad6761e67ee3e799 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 26 Mar 2008 12:32:24 -0700 Subject: fix for bug 3032: * rename pre-glendale start-up config. * warn user when loading a pre-glendale config. --- etc/init.d/vyatta-ofr | 5 +++++ scripts/vyatta-load-config.pl | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'etc') 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 () { + if (/\/\*XORP Configuration File, v1.0\*\//) { + print "Warning: Loading a pre-Glendale configuration.\n"; + print "Do you want to continue? [no] "; + my $resp = ; + 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"); -- cgit v1.2.3