Sha256: eb75dc16b3bc0cd520a6aad0065ad8c7144e05411f2e1d1482d87666adaa5a13

Contents?: true

Size: 594 Bytes

Versions: 44

Compression:

Stored size: 594 Bytes

Contents

#!/bin/bash
while [ 1 ]
do
	string=`curl http://169.254.169.254/latest/meta-data/spot/termination-time`
	if [[ $string == *"Not Found"* ]]
	then
		# no problem
		message="MESSAGE=Heartbeat,INSTANCE=`curl http://169.254.169.254/latest/meta-data/instance-id`"
		#aws sns publish --topic-arn "{{ sns_arn }}" --region {{ region }} --message $message
	else
		message="MESSAGE=Terminate,INSTANCE=`curl http://169.254.169.254/latest/meta-data/instance-id`"
		aws sns publish --topic-arn "{{ sns_arn }}" --region {{ region }} --message $message
		break
	fi
	sleep 2
done

while [ 1 ]
do
	sleep 10
done

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
sumomo-0.10.8 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.10.4 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.10.3 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.10.2 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.10.1 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.10.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.9.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.22 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.21 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.20 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.17 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.16 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.15 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.14 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.13 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.12 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.11 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.10 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.9 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.8 data/sumomo/sources/spot-watcher-poller.sh