Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
if [ $# -ne 1 ]; then
echo "you need to provide private key";
exit 1
key=`echo $1 | sed 's/[0-9a-fA-F]*//'`
if [ -n "$key" ];
echo "provided key must be in hexadecimal format"
exit 2
# 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
# ---- }
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