Advertisement
odcold

adguard add/remove clients

Jan 4th, 2025
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. opkg install curl jq
  2.  
  3. curl --silent http://localhost:79/rci/show/ip/hotspot | \
  4. jq -c '.host[] | select(.dhcp.static != null) | {ids: [.ip], name: .name, tags: [], upstreams : [], use_global_blocked_services: true, use_global_settings: true}' | \
  5. while read postbody; do
  6.     curl --header 'Content-Type: application/json' --request POST --data-binary "$postbody" http://user:pass@localhost:3000/control/clients/add
  7. done
  8.  
  9.  
  10. #!/bin/sh
  11.  
  12. API='http://user:pass@localhost:3000/control'
  13. curl --silent $API/clients | jq -c '.clients[] | {name: .name}' | \
  14. while read postbody; do
  15.     curl --header 'Content-Type: application/json' --request POST --data-binary "$postbody" $API/clients/delete
  16. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement