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.8.7 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.6 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.4 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.3 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.2 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.1 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.8.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.7.3 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.7.2 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.7.1 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.6.4 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.6.3 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.6.2 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.6.1 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.6.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.5.2 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.5.1 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.5.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.4.0 data/sumomo/sources/spot-watcher-poller.sh
sumomo-0.3.0 data/sumomo/sources/spot-watcher-poller.sh