Guest User

Untitled

a guest
Mar 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. _RESPONSE=$(curl -u usr:pass -s %IP/REST?API....%)
  6.  
  7. _GREP=$(cat -A $_RESPONSE | grep -Po '"toString":.*?[^\]".')
  8.  
  9. _MATCH=$(cat $_GREP | sed -n 's/.*(AAA[\/]BBB[\/]CCC[\/]DDD[\/]EEE).*/1/p')
  10.  
  11. echo "$_MATCH"
  12. echo "$_REPONSE"
  13.  
  14. if grep -p fresh $_MATCH; then
  15. echo found
  16. else
  17. echo not found
  18. fi
Add Comment
Please, Sign In to add comment