Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- clear
- echo "Database Name: "
- read -e dbname
- echo "Database User: "
- read -e dbuser
- echo "Database Password: "
- read -s dbpass
- echo "FULLPATH to docroot: "
- read -e fullpath
- echo "Domain Name: (include .com)"
- read -e domainname
- echo "run install? (y/n)"
- read -e run
- if [ "$run" == n ] ; then
- exit
- else
- echo "============================================"
- echo "INSTALLING..."
- echo "============================================"
- if [ -d "$fullpath" ]; then
- echo "Directory exists... exiting"
- exit
- else
- mkdir $fullpath
- cd $fullpath
- curl -O https://wordpress.org/latest.tar.gz
- tar -zxvf latest.tar.gz
- cd wordpress
- cp -rf . ..
- cd ..
- rm -R wordpress
- cp wp-config-sample.php wp-config.php
- perl -pi -e "s/database_name_here/$dbname/g" wp-config.php
- perl -pi -e "s/username_here/$dbuser/g" wp-config.php
- perl -pi -e "s/password_here/$dbpass/g" wp-config.php
- perl -i -pe'
- BEGIN {
- @chars = ("a" .. "z", "A" .. "Z", 0 .. 9);
- push @chars, split //, "!@#$%^&*()-_ []{}<>~\`+=,.;:/?|";
- sub salt { join "", map $chars[ rand @chars ], 1 .. 64 }
- }
- s/put your unique phrase here/salt()/ge
- ' wp-config.php
- mkdir wp-content/uploads
- chmod 775 wp-content/uploads
- echo "Cleaning..."
- rm latest.tar.gz
- echo "========================="
- echo "Adding nginx entries"
- echo "========================="
- wget https://pastebin.com/raw/mf3UYvi6
- perl -pi -e "s~PATHTODIR~$fullpath~g" mf3UYvi6
- perl -pi -e "s/domainname/$domainname/g" mf3UYvi6
- mv ./mf3UYvi6 /etc/nginx/sites-available/$domainname
- ln -s /etc/nginx/sites-available/$domainname /etc/nginx/sites-enabled/$domainname
- echo "Reloading nginx...."
- /etc/init.d/nginx reload
- echo "========================="
- echo "Installation is complete."
- echo "========================="
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement