Difference between revisions of "Extension:EmailToWiki/get EmailToWiki to extensions wmf-shared.sh"

From Biowikifarm Metawiki
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="bash"> #!/bin/bash ###################################################### # Warning: run this only as script not as # copy and paste in console!! #####...")
 
Line 37: Line 37:
 
fi
 
fi
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
[[Category:Bash script]]

Revision as of 15:47, 27 January 2016

#!/bin/bash
######################################################
# Warning: run this only as script not as 
# copy and paste in console!!
######################################################

###################################
usr_share_wiki_path="/usr/share/mediawiki27wmf"
usr_share_extension_path="${usr_share_wiki_path}/extensions-simple-features"

# get external https://www.mediawiki.org/wiki/Extension:EmailToWiki
if ! [[  -d ~"/temp"  ]] ; then
  echo "# Extension:EmailToWiki: create ~/temp"
  mkdir --parents ~"/temp"
fi

echo "# Extension:EmailToWiki: download https://github.com/OrganicDesign/extensions/archive/master.zip"
cd ~/temp && wget https://github.com/OrganicDesign/extensions/archive/master.zip --output-document=OrganicDesign_extensions_master.zip
echo "# Extension:EmailToWiki: unzip OrganicDesign_extensions_master.zip"
unzip OrganicDesign_extensions_master.zip
if [[  -d ~/temp/extensions-master/MediaWiki/EmailToWiki/ ]] ; then
  cd ~/temp/extensions-master/MediaWiki/EmailToWiki/
  echo "# Extension:EmailToWiki: add README.biowikifarm to extension"
  echo "###################################" > README.biowikifarm
  echo "# This is a non MediaWiki extension see: https://www.mediawiki.org/wiki/Extension:EmailToWiki#Installation" >> README.biowikifarm
  echo "# It was downloaded and extracted manually via wget  https://github.com/OrganicDesign/extensions/archive/master.zip " >> README.biowikifarm
  echo "#   wget  https://github.com/OrganicDesign/extensions/archive/master.zip " >> README.biowikifarm
  echo "# and copied manually to this shared wiki directory. If this extension does not function properly after setup" >> README.biowikifarm
  echo "# deactivate and remove it. (AP 2015-12-16)" >> README.biowikifarm
  echo "# Extension:EmailToWiki: copy ~/temp/extensions-master/MediaWiki/EmailToWiki to ${usr_share_extension_path}"
  sudo -u www-data -g www-data cp --recursive ~/temp/extensions-master/MediaWiki/EmailToWiki "${usr_share_extension_path}"
else
  unzip -l OrganicDesign_extensions_master.zip | grep --ignore-case 'emailTowiki'
  echo "# Extension:EmailToWiki: structure of ZIP archive is different from expected"
  echo "# Extension:EmailToWiki: check above (skipped copy extension)"
fi