Commit 68303289 authored by Armando Vega's avatar Armando Vega

Merge branch '2-call-api-in-notify-command-of-cryptops-api' into 'master'

add notify-command to cryptops-api call

Closes #2

See merge request !1
parents 76c8c907 6cb6f246
......@@ -87,7 +87,28 @@ setup_mapping()
fifoPath="/tmp/cryptops-api-stop"
mkfifo $fifoPath
cryptops-api "$rootdevice" "$crypttarget"
for x in $(cat /proc/cmdline); do
case "$x" in
instance_id=*)
instance_id="${x#instance_id=}"
;;
cosmos_url=*)
cosmos_url="${x#cosmos_url=}"
;;
api_key=*)
api_key="${x#api_key=}"
;;
esac
done
notify_command="curl -X POST -H \\\"Authorization: Bearer $api_key\\\"
-H \\\"Content-Type: application/json\\\"
-d '{\\\"template\\\":\\\"ENCVMBOOTED\\\",\\\"HOSTNAME\\\":\\\"$(hostname)\\\",\\\"identifier\\\":\\\"instance-$instance_id\\\"}'
$cosmos_url/api/v2/communication/sendmessage"
cryptops-api "$rootdevice" "$crypttarget" --notify-command="$notify_command"
#FSTYPE=''
#eval $(fstype < "$NEWROOT")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment