Skript pro ukládání fotek z kamer
Z Wiki UnArt Slavičín
#!/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 "-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"