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í
mBez shrnutí editace |
Bez shrnutí editace |
||
Řádek 5: | Řádek 5: | ||
echo "Usage: $0 [options] URL" | echo "Usage: $0 [options] URL" | ||
echo "Options:" | echo "Options:" | ||
echo "-d DIR download to DIR" | echo "-d DIR download to DIR" | ||
echo "-n NAME name of image" | echo "-n NAME name of image" |
Verze z 2. 12. 2011, 06:28
#!/bin/bash function usage() { echo "Usage: $0 [options] URL" echo "Options:" echo "-d DIR download to DIR" echo "-n NAME name of image" echo "-u LOGIN user to authentication" echo "-p 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"