dmctl: l'option -a supporte les répertoires

This commit is contained in:
Jephté Clain 2020-03-29 21:04:44 +04:00
parent ccf3c67278
commit 1c4c1c3faf
1 changed files with 12 additions and 6 deletions

14
dmctl
View File

@ -8,6 +8,7 @@ function display_help() {
USAGE USAGE
$scriptname -d NAME $scriptname -d NAME
$scriptname -l ARCHIVE $scriptname -l ARCHIVE
$scriptname -a ARCHIVEs...
OPTIONS OPTIONS
-d, --dump -d, --dump
@ -131,12 +132,17 @@ case "$action" in
dump) dump_machine "$1";; dump) dump_machine "$1";;
load) load_machine "$1";; load) load_machine "$1";;
loadall) loadall)
if [ $# -gt 0 ]; then [ $# -gt 0 ] || set -- .
archives=("$@") archives=()
else for file in "$@"; do
if [ -d "$file" ]; then
NOCLOBBER=1 NOCLOBBER=1
array_lsfiles archives . "*-machine.tar.gz" array_lsfiles files "$file" "*-machine.tar.gz"
array_extend archives files
else
archives+=("$file")
fi fi
done
for archive in "${archives[@]}"; do for archive in "${archives[@]}"; do
etitle "$archive" etitle "$archive"
load_machine "$archive" load_machine "$archive"