summaryrefslogtreecommitdiff
path: root/app-admin/amazon-ec2-init/files/amazon-ec2.init
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:56:41 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:56:41 +0100
commitd87262dd706fec50cd150aab3e93883b6337466d (patch)
tree246b44c33ad7a57550430b0a60fa0df86a3c9e68 /app-admin/amazon-ec2-init/files/amazon-ec2.init
parent71bc00c87bba1ce31de0dac6c3b7fd1aee6917fc (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-admin/amazon-ec2-init/files/amazon-ec2.init')
-rw-r--r--app-admin/amazon-ec2-init/files/amazon-ec2.init34
1 files changed, 0 insertions, 34 deletions
diff --git a/app-admin/amazon-ec2-init/files/amazon-ec2.init b/app-admin/amazon-ec2-init/files/amazon-ec2.init
deleted file mode 100644
index 29ce3aabd6a8..000000000000
--- a/app-admin/amazon-ec2-init/files/amazon-ec2.init
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- before hostname
- need net.eth0
-}
-
-start() {
- einfo "Fetching metadata from EC2 servers"
-
- ebegin " hostname"
- local hostname=$(wget -t 2 -T 5 -q -O - http://169.254.169.254/latest/meta-data/local-hostname)
- echo "hostname=${hostname}" >> /etc/conf.d/hostname
- eend $?
-
- ebegin " SSH keys"
-
- mkdir -p /root/.ssh
-
- local keys=$(wget -t 2 -T 5 -q -O - http://169.254.169.254/latest/meta-data/public-keys/ | cut -d = -f 1 | xargs echo)
- [ -n "${keys}" ] && \
- wget -t 2 -T 5 -q -O - $(for key in $keys; do echo "http://169.254.169.254/latest/meta-data/public-keys/$key/openssh-key"; done) \
- >> /root/.ssh/authorized_keys \
- 2>/dev/null
-
- if [ -f /root/.ssh/authorized_keys ]; then
- chown root:root /root/.ssh/authorized_keys
- chmod 0600 /root/.ssh/authorized_keys
- fi
-
- eend $?
-}