umirror: ajouter les options -g et -n pour faciliter le téléchargement des livraisons APOGEE

This commit is contained in:
Jephté Clain 2017-05-16 09:26:54 +04:00
parent 5d3f576994
commit bef927cc3b
1 changed files with 14 additions and 3 deletions

17
umirror
View File

@ -10,14 +10,23 @@ USAGE
$scriptname [options] url [wget_options] $scriptname [options] url [wget_options]
OPTIONS OPTIONS
-l -l, --local
Convertir les liens pour consultation locale" Convertir les liens pour consultation locale
-g, --no-robots
Ne pas tenir compte du fichier robots.txt
-n, --no-index
Ne pas télécharger les fichiers de la forme 'index.html*'. Utile pour
faire un miroir d'un site ftp qui est servi en http."
} }
local= local=
no_robots=
no_index=
parse_opts + "${PRETTYOPTS[@]}" \ parse_opts + "${PRETTYOPTS[@]}" \
--help '$exit_with display_help' \ --help '$exit_with display_help' \
-l local=1 \ -l,--local local=1 \
-g,--no-robots no_robots=1 \
-n,--no-index no_index=1 \
@ args -- "$@" && set -- "${args[@]}" || die "$args" @ args -- "$@" && set -- "${args[@]}" || die "$args"
url="$1"; shift url="$1"; shift
@ -31,4 +40,6 @@ fi
args=(-m -p -np) args=(-m -p -np)
[ -n "$local" ] && args=("${args[@]}" -k -K) [ -n "$local" ] && args=("${args[@]}" -k -K)
[ -n "$no_robots" ] && args=("${args[@]}" -e robots=off)
[ -n "$no_index" ] && args=("${args[@]}" -R "index.html*")
wget "${args[@]}" "$@" "$url" wget "${args[@]}" "$@" "$url"