Commit 8eb89297 authored by Maarten de Waard's avatar Maarten de Waard 🤘🏻

add notify-command to cryptops-api call

parent 76c8c907
......@@ -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