Skip to content

Instantly share code, notes, and snippets.

@djaney
Created December 8, 2014 02:39
Show Gist options
  • Select an option

  • Save djaney/b40e9351a4094e8fe3d6 to your computer and use it in GitHub Desktop.

Select an option

Save djaney/b40e9351a4094e8fe3d6 to your computer and use it in GitHub Desktop.
Force install a WordPress MU Plugin to all WHM accounts with wordpress installed
#!/usr/bin/python
import glob
import os
import shutil
def main():
filename = 'syncglobal.php'
path = '/home/*/public_html/wp-content'
for dirpath in glob.glob(path):
muPath = dirpath + '/mu-plugins'
if(os.path.isdir(muPath) == False):
os.mkdir(muPath, 0775)
shutil.copy(filename, muPath )
os.chmod(muPath+'/'+filename,0775)
return
if __name__ =='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment