Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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