+BADWORDS="error\|failure\|unable\|denied\|directory"
+outdir="./"
+
+function output() {
+ if [ $test ] || [ "$EUID" -ne 0 ]; then
+ printf "$2%s\e[0m\n" "$1"
+ else
+ logger -s -t $LOGTAG "$1" >> $LOGFILE
+ fi
+}
+
+usagelong="\e[34m$(basename "$0")\e[0m $VERSION
+Get a list of urls and optional corresponding output paths, then send them to wget
+
+\e[1mUSAGE:\e[0m
+ $(basename "$0") [OPTIONS]
+
+\e[1mOPTIONS:\e[0m
+ -l, --list
+ Text file where each line contains a url and filename separated by a space. Filename is optional.
+ Default: ./queue.txt
+
+ -h, --help
+ Show this help message
+
+ -t, --test
+ Dry run - parses LIST and prints wget commands but does not execute them
+
+ -d, --destination \e[4m<destination>\e[0m
+ Directory in which to save each file in LIST
+ Default: ./
+
+ -a, --args \e[4m<args>\e[0m
+ String of shell arguments which are passed verbatim to wget\n"
+
+usageshort="\e[1mUSAGE:\e[0m
+ $(basename "$0") [OPTIONS] -l LIST
+
+For more information, see \e[34m$(basename "$0") --help\e[0m\n"
+
+if [ "$EUID" -ne 0 ]; then
+ LOGFILE=/dev/null # redirect log because we're probably not running on a cron job
+fi