#!/bin/sh ######################################################################## # Begin $rc_base/init.d/aws ######################################################################## . /etc/sysconfig/rc . ${rc_functions} # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify_ec2_instances.html running_on_ec2() { local uuid # Check if the hypervisor UUID starts with ec2 if [ -r "/sys/hypervisor/uuid" ]; then uuid=$(/dev/null # Rename network devices udevadm trigger --action="add" --subsystem-match="net" exit 0 ;; status) if running_on_ec2; then echo "This system is running on AWS EC2" exit 0 else echo "This system is NOT running on AWS EC2" exit 1 fi ;; *) echo "Usage: ${0} {start|status}" exit 1 ;; esac # End $rc_base/init.d/aws