Skip to content

Instantly share code, notes, and snippets.

@klebermagno
Created June 13, 2019 18:06
Show Gist options
  • Save klebermagno/77feca6d82caceae46eb626f8b8e55cc to your computer and use it in GitHub Desktop.
Save klebermagno/77feca6d82caceae46eb626f8b8e55cc to your computer and use it in GitHub Desktop.
bin
#!/bin/sh
docker exec -it $1 bash
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl http://hosting-033.fiesc.com.br/api/authenticate \
-s -XPOST \
-H 'Content-Type: application/json' \
-H 'Origin: http://hosting-033.fiesc.com.br' \
-H 'Content-Length: 39' \
-H 'Host: hosting-033.fiesc.com.br' \
-H 'Referer: http://hosting-033.fiesc.com.br/' \
-H 'Connection: keep-alive' \
--data-binary '{"username":"admin","password":"admin"}' `
#echo $json
prop='id_token'
picurl=`jsonval`
echo "" $picurl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment