Skip to content

Instantly share code, notes, and snippets.

@rosy1280
Last active September 5, 2015 15:45
Show Gist options
  • Save rosy1280/514261 to your computer and use it in GitHub Desktop.
Save rosy1280/514261 to your computer and use it in GitHub Desktop.
start up script for moodle
#!/bin/bash
#
# start up script for moodle
#
###############################
# Define the Variables
###############################
CURRENT_URL="example.com/moodle"
NEW_URL=`wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname`
#for debugging
#echo $CURRENT_URL
#echo $NEW_URL
/usr/bin/ec2-set-hostname
#echo `hostname`
sed -e 's|'$CURRENT_URL'|'$NEW_URL'|' </var/www/moodle/config-dist.php >/var/www/moodle/config.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment