Created
May 4, 2011 17:56
-
-
Save ryancragun/955661 to your computer and use it in GitHub Desktop.
set hostname db from metadata
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
<?php | |
$METADATA = file("/var/spool/ec2/meta-data-cache.sh"); | |
foreach ($METADATA as $line) { | |
$data = explode ('=',$line); | |
switch ($data[0]) { | |
case "export EC2_HOSTNAME": | |
$hostname_DB = $data[1]; | |
break; | |
} | |
} | |
//DataBase Connect Infomation | |
$database_DB = "phptestdb"; | |
$username_DB = "admin"; | |
$password_DB = "madem0"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment