diff options
Diffstat (limited to 'custom/uucp-mediaserver')
-rwxr-xr-x | custom/uucp-mediaserver/scripts/queue | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/custom/uucp-mediaserver/scripts/queue b/custom/uucp-mediaserver/scripts/queue index 1644bd2d..49c7a3bc 100755 --- a/custom/uucp-mediaserver/scripts/queue +++ b/custom/uucp-mediaserver/scripts/queue | |||
@@ -46,29 +46,13 @@ suffix=${base##*.} | |||
46 | force=0 | 46 | force=0 |
47 | noCall=false | 47 | noCall=false |
48 | prepend=false | 48 | prepend=false |
49 | while getopts "frp" OPT; do | 49 | |
50 | case $OPT in | 50 | typeset -A opts |
51 | r) | 51 | zparseopts -A opts -- r p f:: |
52 | noCall=true | 52 | |
53 | ;; | 53 | force=${opts[-f]:-${+opts[-f]}} |
54 | f) | 54 | [[ -v opts[-p] ]] && prepend=true |
55 | if [[ ${@:$OPTIND} =~ ^[0-9]+$ ]];then | 55 | [[ -v opts[-r] ]] && noCall=true |
56 | force=${@:$OPTIND} | ||
57 | OPTIND=$((OPTIND+1)) | ||
58 | else | ||
59 | force=1 | ||
60 | fi | ||
61 | ;; | ||
62 | p) | ||
63 | prepend=true | ||
64 | ;; | ||
65 | \?) | ||
66 | echo "Invalid option -${OPTARG}" >&2 | ||
67 | exit 2 | ||
68 | ;; | ||
69 | esac | ||
70 | done | ||
71 | shift $((OPTIND-1)) | ||
72 | 56 | ||
73 | printf "force: %d, noCall: %s, prepend: %s\n" ${force} ${noCall} ${prepend} | debug | 57 | printf "force: %d, noCall: %s, prepend: %s\n" ${force} ${noCall} ${prepend} | debug |
74 | 58 | ||