Created
March 18, 2017 01:43
-
-
Save 44uk/f6be3f8f376c93153235e78a6f2c3f77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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