Permalink
Browse files

fix up ownership/permissions in "save template wiki" script

  • Loading branch information...
1 parent 22fb3aa commit 8723cc8c602e5d9d647b0b3d6dbadae03140cd17 @tomclegg tomclegg committed Jul 8, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 wikifarm-template-save
View
@@ -5,11 +5,15 @@ set -e
templatesettings=$WWW/00/LocalSettings.php
sudo mv /var/lib/mediawiki/config/LocalSettings.php $templatesettings
+find $WWW/00 -user root -print0 | xargs -0 sudo chown ubuntu:ubuntu
+sudo chown ubuntu:ubuntu $WWW/00
+sudo chmod 644 $templatesettings
+
sudo tee -a $templatesettings <<'EOF'
$wgArticlePath = "/xxx/$1";
require_once(dirname(__FILE__)."/../DefaultFarmSettings.php");
require_once(dirname(__FILE__)."/../FarmSettings.php");
EOF
-perl -pi~ -e 's/^/#/ if /^define.*MW_INSTALL_PATH/' $templatesettings
+sudo perl -pi~ -e 's/^/#/ if /^define.*MW_INSTALL_PATH/' $templatesettings
echo 'Deny from all' | sudo tee $WWW/00/.htaccess

0 comments on commit 8723cc8

Please sign in to comment.