Last change
on this file since 185 was
131,
checked in by jbarnold, 18 years ago
|
added sql scripts
|
-
Property svn:executable set to
*
|
File size:
405 bytes
|
Rev | Line | |
---|
[131] | 1 | #!/usr/bin/php |
---|
| 2 | <?php |
---|
| 3 | |
---|
| 4 | list($h,$u,$p) = explode("\t",`/mit/scripts/sql/bin/get-password`); |
---|
| 5 | $newdb = str_replace($u.'+','',$argv[1]); |
---|
| 6 | $testdb = str_replace('.','',$u).'+'.$newdb; |
---|
| 7 | $dbs = explode("\n",file_get_contents("http://sql.mit.edu/~sql/tools/list_dbs.php?h=$h&u=$u&p=$p")); |
---|
| 8 | if (in_array($testdb,$dbs)) { |
---|
| 9 | $i = 1; |
---|
| 10 | while(in_array($testdb.$i,$dbs)) { |
---|
| 11 | $i++; |
---|
| 12 | } |
---|
| 13 | echo $newdb.$i; |
---|
| 14 | } else echo $newdb; |
---|
| 15 | |
---|
| 16 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.