Skip to content

Instantly share code, notes, and snippets.

@Jsalinastls
Forked from bgallagh3r/wp.sh
Created September 25, 2019 17:52
Show Gist options
  • Save Jsalinastls/4a447639f567762b7e4761be10adfd15 to your computer and use it in GitHub Desktop.
Save Jsalinastls/4a447639f567762b7e4761be10adfd15 to your computer and use it in GitHub Desktop.

Revisions

  1. @bgallagh3r bgallagh3r revised this gist Jul 8, 2015. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion wp.sh
    Original file line number Diff line number Diff line change
    @@ -35,9 +35,21 @@ 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

    #set WP salts
    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

    #create uploads folder and set permissions
    mkdir wp-content/uploads
    chmod 777 wp-content/uploads
    chmod 775 wp-content/uploads
    echo "Cleaning..."
    #remove zip file
    rm latest.tar.gz
    #remove bash script
  2. @bgallagh3r bgallagh3r revised this gist Nov 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wp.sh
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ echo "============================================"
    echo "A robot is now installing WordPress for you."
    echo "============================================"
    #download wordpress
    curl -O http://wordpress.org/latest.tar.gz
    curl -O https://wordpress.org/latest.tar.gz
    #unzip wordpress
    tar -zxvf latest.tar.gz
    #change dir to wordpress
  3. @bgallagh3r bgallagh3r revised this gist Mar 3, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions wp.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    #!/bin/bash -e
    clear
    echo "============================================"
    echo "WordPress Install Script"
    echo "============================================"
    echo "Database Name: "
    read -e dbname
    echo "Database User: "
  4. @bgallagh3r bgallagh3r revised this gist Mar 3, 2014. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion wp.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/bash
    #!/bin/bash -e
    echo "Database Name: "
    read -e dbname
    echo "Database User: "
    @@ -10,6 +10,9 @@ read -e run
    if [ "$run" == n ] ; then
    exit
    else
    echo "============================================"
    echo "A robot is now installing WordPress for you."
    echo "============================================"
    #download wordpress
    curl -O http://wordpress.org/latest.tar.gz
    #unzip wordpress
    @@ -35,4 +38,7 @@ chmod 777 wp-content/uploads
    rm latest.tar.gz
    #remove bash script
    rm wp.sh
    echo "========================="
    echo "Installation is complete."
    echo "========================="
    fi
  5. @bgallagh3r bgallagh3r revised this gist Feb 22, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions wp.sh
    Original file line number Diff line number Diff line change
    @@ -25,9 +25,9 @@ rm -R wordpress
    #create wp config
    cp wp-config-sample.php wp-config.php
    #set database details with perl find and replace
    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 -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
    #create uploads folder and set permissions
    mkdir wp-content/uploads
    chmod 777 wp-content/uploads
  6. @bgallagh3r bgallagh3r revised this gist Feb 22, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions wp.sh
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    #!/bin/bash
    echo Database Name:
    echo "Database Name: "
    read -e dbname
    echo Database User:
    echo "Database User: "
    read -e dbuser
    echo Database Password:
    echo "Database Password: "
    read -s dbpass
    echo run install? (y/n)
    echo "run install? (y/n)"
    read -e run
    if [ "$run" == n ] ; then
    exit
  7. @bgallagh3r bgallagh3r created this gist Jun 1, 2012.
    38 changes: 38 additions & 0 deletions wp.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    #!/bin/bash
    echo “Database Name: ”
    read -e dbname
    echo “Database User: ”
    read -e dbuser
    echo “Database Password: ”
    read -s dbpass
    echo “run install? (y/n)”
    read -e run
    if [ "$run" == n ] ; then
    exit
    else
    #download wordpress
    curl -O http://wordpress.org/latest.tar.gz
    #unzip wordpress
    tar -zxvf latest.tar.gz
    #change dir to wordpress
    cd wordpress
    #copy file to parent dir
    cp -rf . ..
    #move back to parent dir
    cd ..
    #remove files from wordpress folder
    rm -R wordpress
    #create wp config
    cp wp-config-sample.php wp-config.php
    #set database details with perl find and replace
    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
    #create uploads folder and set permissions
    mkdir wp-content/uploads
    chmod 777 wp-content/uploads
    #remove zip file
    rm latest.tar.gz
    #remove bash script
    rm wp.sh
    fi