On 17/04/13 20:33, Kenneth Jacker wrote:
Not sure what you mean here ...
Use 'find' and the shell to do what?
Sorry if I'm being dumb/dense,
[root@TestServer ~]# find /var/www/sites -name settings.php /var/www/sites/testserver/sites/default/settings.php [root@TestServer ~]#
The settings.php directories show which sites' databased need to be updated. I don't have multiple sites set up so it's hard to demonstrate.
To work back a little, [root@TestServer ~]# find /var/www/sites -name settings.php -exec dirname {} ; /var/www/sites/testserver/sites/default [root@TestServer ~]# When I set up multisites under D6, there were directories beside /var/www/sites/testserver/sites/default that reflected the domain names of the sites .
I think that still works, but now there is also sites.php. If you can code in PHP (I can't really), then you can read that in PHP and work on the $sites array.
This demonstrates making some sense of the sites.php from the commandline: [root@TestServer ~]# cat /var/www/sites/testserver/sites/example.sites.php | awk '/$sites[/ {if ($2 ~ ".sites") { printf "%s\t%s\t%s\t%s\n", $1, $2, $3,$4}}' * $sites['dev.drupal.org'] = 'example.com'; * $sites['localhost.example'] = 'example.com'; * $sites['8080.localhost.example'] = 'example.com'; * $sites['8080.www.drupal.org.mysite.test'] = 'example.com'; [root@TestServer ~]#
Note that in reality you would have "if ($1" etc, I used 2 here to test the second word to show the kind of output you should expect.