Great work on Quickstart! I was just looking at the code in quickstart.inc and thought this duplication detection script might help as I saw you had a 'fixme' in line 65. It works for me.
Cheers,
Crom
function quickstart_create_dns($domain, $params) {
// FIXME detect duplicates
$file = file_get_contents("/etc/hosts");
if(!strpos($file, $domain)) {
quickstart_shell_exec("echo '127.0.0.1 $domain #quickstart' | sudo tee -a /etc/hosts");
echo "$file, $domain, strpos($file, $domain)";
}else{
echo "entry found...doing nothing";
}
}
Comments
Comment #1
Crom commentedWhoops, just noticed I left some duff code in...
Comment #2
MichaelCole commentedSweet! Thanks!
Comment #3
Crom commentedNo problem...happy to help. I also wanted to put a check in where the script detects whether or not the website folder already exists. It doesn't exit very elegantly but here's the code in case it's useful - also with fancy yellow highlighting ;-)
This is for around line 207 of quickstart.inc (apologies for not making patch files but a bit pushed for time).
Comment #4
MichaelCole commentedComment #5
mike stewart commentedI need a patch. I will eventually do myself if no one else does first: http://drupal.org/project/quickstart/git-instructions (see section on patching)
Comment #6
mike stewart commentedre-wrote DNS check based on #1. committed to 7.x-2.x