[wp-hackers] Getting list of plugins from shell script

Mike Schinkel mikeschinkel at newclarity.net
Tue Aug 3 08:38:14 UTC 2010


Scot:

Why don't you call a PHP script from the shell?  Problem is that option is serialized and you'll find it easiest to get PHP to unserialize it for you.

Here's a shell script that will do for you:  http://gist.github.com/506055

-Mike



On Aug 3, 2010, at 3:56 AM, Scot Hacker wrote:

> Kind of obscure, but wondering if anyone has a script or command that can be used to derive a list of active plugins from the shell (not from PHP). I have this so far:
> 
> # Get list of active plugins from db
> raw_plugins_sql="SELECT option_value FROM $dbname.wp_options WHERE option_name = 'active_plugins';"
> echo $raw_plugins_sql
> mysql -u root -e "$raw_plugins_sql" -p$root_db_pass $dbname
> 
> But the output is really messy and I can't seem to get any further with it (this  is part of a script where I'm trying to get a per-site listing of  active plugins used on each site on a server). Maybe need an awk expert here :)
> 
> Thanks,
> Scot
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list