cPanel-wp-management icon indicating copy to clipboard operation
cPanel-wp-management copied to clipboard

Invert nonwp

Open nbwpuk opened this issue 8 years ago • 2 comments

I see the way that the nonwp file works but is there a way to invert the logic so that a file, say "managewp", could hold a list of accounts to cycle through?

nbwpuk avatar Jan 25 '17 16:01 nbwpuk

Definitely! If you were to make a managewp file that contains the usernames you only want to manage, you would want to have each username on its own line within it. Then you'll want to edit https://github.com/MarioKnight/cPanel-wp-management/blob/master/acct-common.sh#L3 to

accounts= `cat "$(dirname "$0")"/managewp`

Line 2 could be removed for optimization. This should be the only change that would need to be made if you wanted to invert the behavior. Please give it a shot and let me know how it works for you!

MarioKnight avatar Feb 01 '17 19:02 MarioKnight

@MarioKnight I have forked this repo here: https://github.com/EncodeDesign/cPanel-wp-management then copied all files into a "managed" folder. I made the edit as above to acct-common.sh but encounter an error when run (webdesign is a test account I have setup on the server and is listed in the managewp file):

[~/cPanel-wp-management/managed]# ./wp-version.sh ./acct-common.sh: line 2: webdesign: command not found

nbwpuk avatar Feb 06 '17 10:02 nbwpuk