Skript pro ukládání fotek z kamer: Porovnání verzí
Z Wiki UnArt Slavičín
Skočit na navigaciSkočit na vyhledávání
(Založena nová stránka: #!/bin/bash function usage() { echo "Usage: $0 [options] URL" echo "Options:" echo "-h print this help" echo "-d DIR download...) |
Bez shrnutí editace |
||
Řádek 8: | Řádek 8: | ||
echo "-d DIR download to DIR" | echo "-d DIR download to DIR" | ||
echo "-n NAME name of image" | echo "-n NAME name of image" | ||
echo "-u LOGIN user to authentication" | |||
echo "-u PASSWD password to authentication" | |||
} | } | ||
Verze z 2. 12. 2011, 06:27
#!/bin/bash function usage() { echo "Usage: $0 [options] URL" echo "Options:" echo "-h print this help" echo "-d DIR download to DIR" echo "-n NAME name of image" echo "-u LOGIN user to authentication" echo "-u PASSWD password to authentication" } DIR=`pwd`"/" NAME=`date +%Y%m%d%H%M`".jpg" USER="" PASSWORD="" while getopts "d:n:p:u:" o; do case "$o" in d) DIR="$OPTARG" ;; n) NAME="$OPTARG" ;; p) PASSWORD="$OPTARG" ;; u) USER="$OPTARG" ;; esac done shift $((OPTIND-1)) if [ -z "$1" ] then usage exit 1 fi wget "$1" --user "$USER" --password "$PASSWORD" -O "$DIR$NAME"