diff --git a/build/scripts/local-top/cryptroot-api b/build/scripts/local-top/cryptroot-api index 0e871b242e5ab73fb8380e0d8825161b02d383c4..f9245508db88012c938c3b86f0a2eac5076c6732 100755 --- a/build/scripts/local-top/cryptroot-api +++ b/build/scripts/local-top/cryptroot-api @@ -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")