Skip to content

Instantly share code, notes, and snippets.

@44uk
Created March 18, 2017 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 44uk/f6be3f8f376c93153235e78a6f2c3f77 to your computer and use it in GitHub Desktop.
Save 44uk/f6be3f8f376c93153235e78a6f2c3f77 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "you need to provide private key";
exit 1
fi
key=`echo $1 | sed 's/[0-9a-fA-F]*//'`
if [ -n "$key" ];
then
echo "provided key must be in hexadecimal format"
exit 2
fi
# additional script { ----
echo -n "waiting for NIS to recieve request."
until (curl -m 1s -s -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:7890/status | grep -ioE '"code":6' > /dev/null); do
echo -n "."
sleep 1s
done
# ---- }
curl -s -H "Accept: application/json" -H "Content-Type: application/json" -d "{'value':'$1'}" http://localhost:7890/account/unlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment