]>
git.rmz.io Git - dotfiles.git/blob - bin/addnzb
   5 source $XDG_CONFIG_HOME/sabnzbd
/config
 
  11     echo "Usage :  $0 [options] 
  14     --category      Sets the category 
  15     -h,--help       Display this message 
  16     -v,--version    Display script version" 
  21 while [[ $# -gt 0 ]]; do 
  25         -h|--help)     usage
; exit 0 ;; 
  26         -v|--version)  echo "$0 -- Version $version"; exit 0 ;; 
  27         --category)    category
=$2; shift 2 ;; 
  29             echo -e "\n  Option does not exist : $opt\n" 
  32         *) args
+=("$opt"); shift ;; 
  36 # set priority to high 
  37 extra_data
=(-F priority
=1) 
  38 if [[ -n $category ]]; then 
  39     extra_data
+=(-F cat=$category) 
  42 for f 
in ${args[@]}; do 
  43     curl 
--silent --show-error \
 
  45         -F apikey
="$API_KEY" \
 
  49     if [[ $? 
-eq 0 ]]; then 
  53         echo "Failed to upload '$f'"