]>
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 if [[ -n $category ]]; then 
  37     extra_data
="-F cat=$category" 
  40 for f 
in ${args[@]}; do 
  41     curl 
-s -F apikey
="$API_KEY" -F mode
="addfile" -F name
=@
"$f" $extra_data $URL/sabnzbd
/api 
&> /dev
/null
 
  42     if [[ $? 
-eq 0 ]]; then 
  46         echo "Failed to upload '$f'"