Skip to content

Instantly share code, notes, and snippets.

@mahfuzul
Last active August 29, 2015 14:13
Show Gist options
  • Save mahfuzul/72676591f6ade31aba53 to your computer and use it in GitHub Desktop.
Save mahfuzul/72676591f6ade31aba53 to your computer and use it in GitHub Desktop.
setwp function download and extract wordpress from https://wordpress.org
#!/bin/zsh
# @author: Mahfuzul Hasan <mha.cse@gmail.com>
# setwp function download and extract wordpress from https://wordpress.org
# To execute this function run this commands:
# chmod +x setwp.sh
# ./setwp.sh
# or add this file as a source in your .zshrc / .bashrc file " source ~/bin/zsh/setwp.sh "
#
setwp(){
echo "Downloading....."
wget --no-check-certificate https://wordpress.org/latest.zip
echo "Extracting....."
unzip latest.zip
echo "Moving into public_html....."
mv wordpress/* public_html/.
echo "Removing latest.zip & wordpress folder....."
rm -rf latest.zip
rm -rf wordpress
echo "Changing dir to public_html"
cd public_html
echo -n "Do you want to create wp-config.php file? Y/n : "
read cmd
if [ $cmd = "Y" ] || [ $cmd = "y" ]
then
cp wp-config-sample.php wp-config.php
echo "wp-config.php file created"
else
echo "wp-config.php file not created"
fi
echo "Job Done! Have fun"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment