Skip to content

Commit

Permalink
Add nzb move command.
Browse files Browse the repository at this point in the history
  • Loading branch information
drn committed Sep 13, 2023
1 parent c0c6be5 commit 99a2943
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/nzb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# move to nzb watch

if [[
"$#" -ne 1 || (
"$1" != "movies" &&
"$1" != "tv" &&
"$1" != "safe"
) ]]; then
echo "Usage: nzb [movies/tv/safe]"
exit 1
fi

target=$1

cd ~/Downloads || exit 1
shopt -s nullglob
nzbs=(*.nzb)
if [ ${#nzbs[@]} -eq 0 ]; then
echo -e "\033[00;31mNo nzbs found\033[0m"
else
for nzb in "${nzbs[@]}"; do
mv $nzb "/Volumes/data/incoming/usenet/watched/$target"
done
fi
5 changes: 5 additions & 0 deletions zsh/completion/_nzb.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function _nzb {
_arguments '1: :(movies tv safe)'
}

compdef _nzb nzb

0 comments on commit 99a2943

Please sign in to comment.