apply shellcheck

This commit is contained in:
Simon Vieille 2019-05-06 15:34:50 +02:00
parent 0408a8b900
commit bb48e715e7
Signed by: deblan
GPG key ID: 03383D15A1D31745

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
usage() { usage() {
printf "Usage: %s [url] [filters] [-h|--help|--wget|--httrack]\n\n" $0 printf "Usage: %s [url] [filters] [-h|--help|--wget|--httrack]\n\n" "$0"
printf " --wget Select GNU Wget\n" printf " --wget Select GNU Wget\n"
printf " --httrack Select httrack to vacuum\n" printf " --httrack Select httrack to vacuum\n"
@ -13,11 +13,11 @@ usage() {
TOOL= TOOL=
URL= URL=
for i in $@; do for i in "$@"; do
if [ "$i" = "-h" -o "$i" = "--help" ]; then if [ "$i" = "-h" ] || [ "$i" = "--help" ]; then
usage usage
exit 0 exit 0
elif [ "$i" != "--httrack" -a "$i" != "--wget" ]; then elif [ "$i" != "--httrack" ] && [ "$i" != "--wget" ]; then
URL="$URL $i" URL="$URL $i"
elif [ "$i" = "--httrack" ]; then elif [ "$i" = "--httrack" ]; then
TOOL=httrack TOOL=httrack
@ -49,9 +49,9 @@ if [ -z "$TOOL" ]; then
TOOL=1 TOOL=1
fi fi
if [ "$TOOL" = "1" -o "$TOOL" = "httrack" ]; then if [ "$TOOL" = "1" ] || [ "$TOOL" = "httrack" ]; then
TOOL=httrack TOOL=httrack
elif [ "$TOOL" = "2" -o "$TOOL" = "wget" ]; then elif [ "$TOOL" = "2" ] || [ "$TOOL" = "wget" ]; then
TOOL=wget TOOL=wget
else else
TOOL= TOOL=
@ -63,6 +63,6 @@ if [ "$TOOL" = "httrack" ]; then
printf "\nCommand:\n\n httrack %s\n\n" "$URL" printf "\nCommand:\n\n httrack %s\n\n" "$URL"
httrack $URL httrack $URL
elif [ "$TOOL" = "wget" ]; then elif [ "$TOOL" = "wget" ]; then
printf "\nCommand:\n\n wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox \"%s\"\n\n" $URL printf "\nCommand:\n\n wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox \"%s\"\n\n" "$URL"
wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox $URL wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox $URL
fi fi