#!/bin/sh ######################################################################## # Begin $rc_base/init.d/aws ######################################################################## . /etc/sysconfig/rc . ${rc_functions} MD_URL="http://169.254.169.254/latest/meta-data" # 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=$( /var/ipfire/main/settings fi # Remove any IP addresses ip addr flush dev "${intf}" echo_ok # This script has now completed the first steps of setup touch /var/ipfire/main/firstsetup_ok ;; 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