Last active 1754565888

Pause all items in SABnzbd queue

zer0 revised this gist 1754565887. Go to revision

1 file changed, 1 insertion, 1 deletion

sab_queue_pause_all.sh

@@ -1,7 +1,7 @@
1 1 #!/usr/bin/zsh
2 2
3 3 # ==== Configuration ====
4 - SABNZBD_HOST="" # IP or FQDN
4 + SABNZBD_HOST="" # IP or FQDN with port if on non-standard port
5 5 API_KEY="" # API key
6 6 HTTP_SCHEME="" # http or https
7 7

zer0 revised this gist 1754126864. Go to revision

1 file changed, 1 insertion, 1 deletion

sab_queue_pause_all.sh

@@ -10,7 +10,7 @@ JOB_IDS=($(curl -s "$HTTP_SCHEME://$SABNZBD_HOST/sabnzbd/api?apikey=$API_KEY&mod
10 10
11 11 # ==== Pause Each Job ====
12 12 for ID in $JOB_IDS; do
13 - curl -s "$HTTP_SCHEME://${SABNZBD_HOST}/sabnzbd/api?apikey=${API_KEY}&mode=queue&name=pause&value=$ID" > /dev/null
13 + curl -s "$HTTP_SCHEME://$SABNZBD_HOST/sabnzbd/api?apikey=$API_KEY&mode=queue&name=pause&value=$ID" > /dev/null
14 14 echo "Paused job: $ID"
15 15 done
16 16

zer0 revised this gist 1754126788. Go to revision

1 file changed, 17 insertions

sab_queue_pause_all.sh(file created)

@@ -0,0 +1,17 @@
1 + #!/usr/bin/zsh
2 +
3 + # ==== Configuration ====
4 + SABNZBD_HOST="" # IP or FQDN
5 + API_KEY="" # API key
6 + HTTP_SCHEME="" # http or https
7 +
8 + # ==== Extract Job IDs ====
9 + JOB_IDS=($(curl -s "$HTTP_SCHEME://$SABNZBD_HOST/sabnzbd/api?apikey=$API_KEY&mode=queue&output=json" | jq -r '.queue.slots[].nzo_id'))
10 +
11 + # ==== Pause Each Job ====
12 + for ID in $JOB_IDS; do
13 + curl -s "$HTTP_SCHEME://${SABNZBD_HOST}/sabnzbd/api?apikey=${API_KEY}&mode=queue&name=pause&value=$ID" > /dev/null
14 + echo "Paused job: $ID"
15 + done
16 +
17 + echo "All queue items individually paused."
Newer Older