#!/bin/zsh # # dreamUpload is a tiny FTP upload script for DreamBox users. # constants to update VERSION=0.3 DATE=2009-03-07 # local vars dir=`dirname $0` print=1 create=0 delete=0 version() { sed -e 's/^\t\t//' <&2 exit $1 } # parse command line options TEMP=`getopt -o cdhpqv --long create,delete,help,print,quiet,version \ -n 'dreamUpload' -- "$@"` if [ $? != 0 ] ; then usage ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -c|--create) create=1; shift ;; -d|--delete) delete=1; shift ;; -h|--help) help ; exit 0 ;; -p|--print) print_cmds="echo"; shift ;; -q|--quiet) print=0; shift ;; -v|--version) version ; exit 0 ;; --) shift ; break ;; *) echo "Unknown option \"$1\"!" usage ; exit 1 ;; esac done # check number of parameters if [[ $# < 2 ]] { sed -e 's/^\t\t//' >&2 <