From e0c3601ff8bbb8da057b7784bf096ca088012556 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 28 Jun 2011 12:51:49 -0500 Subject: Use proper directory for disk-installs. Do completion of directory names only in clone system config since disk installs will have other files in /live/image/boot --- scripts/vyatta-image-tools.pl | 4 +++- templates/clone/system/config/node.tag/from/node.tag/node.def | 2 +- templates/clone/system/config/node.tag/node.def | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl index 067ab28..2973c3f 100755 --- a/scripts/vyatta-image-tools.pl +++ b/scripts/vyatta-image-tools.pl @@ -197,7 +197,9 @@ sub update { if (y_or_n("$msg")){ system("rm -rf $to/config.preclone"); system("mv $to/config $to/config.preclone") if ( -d "$to/config" ); - if (rsync("$from/config", $to) > 0){ + my $confdir="config"; + $confdir="opt/vyatta/etc/config" if ( $f_topdir eq "disk-install" ); + if (rsync("$from/$confdir", $to) > 0){ print "Clone Failed!\nRestoring old config\n"; system("mv $to/config.preclone $to/config"); } diff --git a/templates/clone/system/config/node.tag/from/node.tag/node.def b/templates/clone/system/config/node.tag/from/node.tag/node.def index 6061efd..d5d7f67 100644 --- a/templates/clone/system/config/node.tag/from/node.tag/node.def +++ b/templates/clone/system/config/node.tag/from/node.tag/node.def @@ -1,5 +1,5 @@ help: Image to update from -allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) +allowed: reply=( $(compgen -d /live/image/boot/ | grep -v grub) ) for i in `seq 0 $[${#reply[@]}-1]`; do file=${reply[$i]} reply[$i]=${file/#\/live\/image\/boot\//} diff --git a/templates/clone/system/config/node.tag/node.def b/templates/clone/system/config/node.tag/node.def index d4a04c0..be028c9 100644 --- a/templates/clone/system/config/node.tag/node.def +++ b/templates/clone/system/config/node.tag/node.def @@ -1,5 +1,5 @@ help: Image to update -allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) +allowed: reply=( $(compgen -d /live/image/boot/ | grep -v grub) ) for i in `seq 0 $[${#reply[@]}-1]`; do file=${reply[$i]} reply[$i]=${file/#\/live\/image\/boot\//} -- cgit v1.2.3