Created
December 3, 2015 18:03
-
-
Save erikaheidi/899231fbfea21d0daf2b to your computer and use it in GitHub Desktop.
Simple shell script to install Nginx on CentOS using DigitalOcean's metadata/userdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum install epel-release -y | |
yum install nginx -y | |
export HOSTNAME=$(curl -s http://169.254.169.254/metadata/v1/hostname) | |
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) | |
echo Droplet: $HOSTNAME, IP Address: $PUBLIC_IPV4 > /usr/share/nginx/html/index.html | |
systemctl enable nginx | |
systemctl start nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
``nginx-userdata-centos.sh