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
1 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
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 " --httrack Select httrack to vacuum\n"
@ -13,11 +13,11 @@ usage() {
TOOL=
URL=
for i in $@; do
if [ "$i" = "-h" -o "$i" = "--help" ]; then
for i in "$@"; do
if [ "$i" = "-h" ] || [ "$i" = "--help" ]; then
usage
exit 0
elif [ "$i" != "--httrack" -a "$i" != "--wget" ]; then
elif [ "$i" != "--httrack" ] && [ "$i" != "--wget" ]; then
URL="$URL $i"
elif [ "$i" = "--httrack" ]; then
TOOL=httrack
@ -49,9 +49,9 @@ if [ -z "$TOOL" ]; then
TOOL=1
fi
if [ "$TOOL" = "1" -o "$TOOL" = "httrack" ]; then
if [ "$TOOL" = "1" ] || [ "$TOOL" = "httrack" ]; then
TOOL=httrack
elif [ "$TOOL" = "2" -o "$TOOL" = "wget" ]; then
elif [ "$TOOL" = "2" ] || [ "$TOOL" = "wget" ]; then
TOOL=wget
else
TOOL=
@ -63,6 +63,6 @@ if [ "$TOOL" = "httrack" ]; then
printf "\nCommand:\n\n httrack %s\n\n" "$URL"
httrack $URL
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
fi