diff options
author | John Estabrook <jestabro@vyos.io> | 2020-12-30 10:40:14 -0600 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2021-01-04 18:10:36 +0200 |
commit | 46f7aca3e98472c15f37c74d4097fd5e97542cda (patch) | |
tree | 3103c3b47a7cc8e4a8242d3fbcdf3afeebdefc92 /scripts | |
parent | 495bc2cffc1bf4d6b59796b8a1cefe6838352418 (diff) | |
download | vyatta-cfg-system-46f7aca3e98472c15f37c74d4097fd5e97542cda.tar.gz vyatta-cfg-system-46f7aca3e98472c15f37c74d4097fd5e97542cda.zip |
migration: T3161: remove scripts ec2-vyos-init, ec2-check.pl
These scripts have been superseded by the cloud-init tools, and contain
legacy references to XorpConfigParser.pm (via
vyatta-cfg/scripts/vyatta-load-config.pl, via ConfigLoad.pm), which one
would like to retire.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ec2-check.pl | 40 | ||||
-rwxr-xr-x | scripts/install/install-image-existing | 31 |
2 files changed, 0 insertions, 71 deletions
diff --git a/scripts/ec2-check.pl b/scripts/ec2-check.pl deleted file mode 100755 index 03448ff5..00000000 --- a/scripts/ec2-check.pl +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env perl -# **** License **** -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# This code was originally developed by VyOS Development Group -# All Rights Reserved. -# -# Author: Daniil Baturin <daniil@baturin.org> -# Description: Check if we are running on an EC2 instance. -# If both system UUID and system serial number start with "EC2", -# most likely we are. -# -# **** End License **** - - -use strict; -use warnings; - -my $DMIDECODE = "/usr/sbin/dmidecode"; - -my $UUID = `$DMIDECODE -s system-uuid`; -my $SN = `$DMIDECODE -s system-serial-number`; - -if( ($UUID =~ /^ec2.*/i) && - ($SN =~ /^ec2.*/i) ) -{ - exit(0); -} -else -{ - exit(1); -} - diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 62b7f80e..0acfcb1f 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -36,29 +36,6 @@ get_grub_index () { fi } -# 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") - if [ -n "$ami_id" ]; then - echo "Installing on VyOS AMI" - - # Create init script links for /etc/init.d/ec2-vyos-init - chroot $INST_ROOT update-rc.d ec2-vyos-init defaults &>/dev/null - - # Dijkstra, forgive us! - return 0 - else - return 1 - fi -} - if [ $(id -u) != 0 ]; then echo "Image installation requires root privileges!" exit 1 @@ -287,14 +264,6 @@ if [ -e "$DEF_GRUB" ]; then mv $BOOT_DIR/%%default_image $BOOT_DIR/%%default_image.orig ln -s $NEWNAME $BOOT_DIR/%%default_image fi - - # Modify grub.cfg for AWS EC2 AMI - if is_amazon_ec2_ami; then - sed -i "/menuentry \"VyOS $NEWNAME (Serial/{N;N;N;N;d;}" $BOOT_DIR/grub/grub.cfg - sed -i "/menuentry \"Lost password change $NEWNAME/{N;N;N;N;d;}" $BOOT_DIR/grub/grub.cfg - sed -i "s/VyOS $NEWNAME (KVM console)/VyOS AMI (HVM) $NEWNAME/" $BOOT_DIR/grub/grub.cfg - sed -i "s/$NEWNAME console=ttyS0.*/$NEWNAME console=ttyS0/" $BOOT_DIR/grub/grub.cfg - fi fi logger -p local3.warning -t "SystemImage" "System Image $NEWNAME has been added and made the default boot image" |