diff --git a/scripts/.local/bin/vidl b/scripts/.local/bin/vidl index 5192922..86b34bf 100755 --- a/scripts/.local/bin/vidl +++ b/scripts/.local/bin/vidl @@ -33,7 +33,7 @@ Options: urls=("$@") -while getopts "t:f:d:hcp" opt; do +while getopts "t:f:d:hcpP" opt; do case "$opt" in # v) verbose=1 # ;; @@ -50,6 +50,9 @@ while getopts "t:f:d:hcp" opt; do ONLY_DO=clear ;; p) + ONLY_DO=status + ;; + P) ONLY_DO=remaining ;; h | \? | *) @@ -155,6 +158,7 @@ is_in_queue() { # 1=url } add_to_queue() { # 1=url + if is_in_queue "$1"; then return; fi echo "$1" >>"$queue_file" echo "added $url to queue." @@ -193,6 +197,14 @@ print_queue_remaining() { wc -l "$queue_file" | cut -f1 -d' ' } +print_status() { + if is_only_instance; then + printf "stopped\n" + return + fi + printf "running\n" +} + main() { setup if [ "$ONLY_DO" = "clear" ]; then @@ -201,6 +213,9 @@ main() { elif [ "$ONLY_DO" = "remaining" ]; then print_queue_remaining exit + elif [ "$ONLY_DO" = "status" ]; then + print_status + exit fi for url in "$@"; do