diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-10-08 12:06:04 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-10-08 12:06:04 +0200 |
commit | 4f2f5df4798278c0ea18202b11854bc9c0559217 (patch) | |
tree | d2b4bea9f4a19859c2d5aaf517bb2204566e6ff1 | |
parent | e16b0e4fbfaff34691bdffc610ba9afa1f87957e (diff) | |
download | vyatta-cfg-system-4f2f5df4798278c0ea18202b11854bc9c0559217.tar.gz vyatta-cfg-system-4f2f5df4798278c0ea18202b11854bc9c0559217.zip |
If not running on AWS (system UUID and serial do not start with EC2), don't do AWS-specific things.
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | etc/init.d/ec2-fetch-ssh-public-key | 6 | ||||
-rwxr-xr-x | scripts/install/install-image-existing | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 88bbf983..aecadb89 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,6 +77,7 @@ sbin_SCRIPTS += scripts/vyatta-bridgegroup-depedency.pl sbin_SCRIPTS += scripts/vyatta-dhcpv6-client.pl sbin_SCRIPTS += scripts/vyatta-update-grub.pl sbin_SCRIPTS += scripts/vyos-intfwatchd +sbin_SCRIPTS += scripts/ec2-check.pl sbin_PROGRAMS = src/valid_address sbin_PROGRAMS += src/local_ip diff --git a/etc/init.d/ec2-fetch-ssh-public-key b/etc/init.d/ec2-fetch-ssh-public-key index 05955f05..3d081d63 100644 --- a/etc/init.d/ec2-fetch-ssh-public-key +++ b/etc/init.d/ec2-fetch-ssh-public-key @@ -17,6 +17,12 @@ . /lib/lsb/init-functions +# Are we running on AWS? +/opt/vyatta/sbin/ec2-check.pl +if [ $? != 0 ]; then + exit 0 +fi + : ${vyatta_env:=/etc/default/vyatta} source $vyatta_env diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index ffb5bba3..2705ce5c 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -38,6 +38,11 @@ get_grub_index () { # Check if installing on AWS EC2 AMI is_amazon_ec2_ami () { + /opt/vyatta/sbin/ec2-check.pl + if [ $? != 0 ]; then + return 1 + fi + ami_id_url=http://169.254.169.254/latest/meta-data/ami-id ami_id=$(/usr/bin/curl --silent "$ami_id_url") |