Browse Source

Install Script for postfix pma adminer wp-cli

old-stable
gau1991 11 years ago
parent
commit
8331c5c3bc
  1. 2
      src/lib/ee_lib_variables.sh
  2. 12
      src/modules/system/install/ee_mod_install_postfix.sh
  3. 16
      src/vendor/ee_ven_install_adminer.sh
  4. 25
      src/vendor/ee_ven_install_pma.sh
  5. 21
      src/vendor/ee_ven_install_wp_cli.sh

2
src/lib/ee_lib_variables.sh

@ -8,6 +8,8 @@ readonly EE_CONFIG_GET=$(echo "git config --file /etc/easyengine/ee.conf")
readonly EE_CONFIG_SET=$(echo "git config --file /etc/easyengine/ee.conf" --replace-all) readonly EE_CONFIG_SET=$(echo "git config --file /etc/easyengine/ee.conf" --replace-all)
readonly EE_IP_ADDRESS=$($EE_CONFIG_GET system.ip-address | cut -d'=' -f2 | sed 's/ //g' | tr ',' '\n') readonly EE_IP_ADDRESS=$($EE_CONFIG_GET system.ip-address | cut -d'=' -f2 | sed 's/ //g' | tr ',' '\n')
readonly EE_APT_GET=$($EE_CONFIG_GET system.apt-get-assume-yes | grep -i true &> /dev/null && echo apt-get -y || echo apt-get) readonly EE_APT_GET=$($EE_CONFIG_GET system.apt-get-assume-yes | grep -i true &> /dev/null && echo apt-get -y || echo apt-get)
readonly EE_WPCLI_VERSION='0.15.1'
readonly EE_ADMINER_VERSION='4.1.0'
# Distribution specific variable # Distribution specific variable
if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then

12
src/modules/system/install/ee_mod_install_postfix.sh

@ -0,0 +1,12 @@
# Install Postfix
function ee_mod_install_postfix()
{
# Setup Postfix
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
debconf-set-selections <<< "postfix postfix/mailname string $(hostname -f)"
# Install Postfix
ee_lib_echo "Installing Postfix, Please Wait..."
$EE_APT_GET install postfix || ee_lib_error "Unable to install postfix, exit status = " $?
}

16
src/vendor/ee_ven_install_adminer.sh

@ -0,0 +1,16 @@
# Install Adminer
function ee_ven_install_adminer()
{
if [ ! -d /var/www/22222/htdocs/db/adminer ]; then
# Setup Adminer
mkdir -p /var/www/22222/htdocs/db/adminer/ \
|| ee_lib_error "Unable to create Adminer directory: /var/www/22222/htdocs/db/adminer/, exit status = " $?
# Download Adminer
ee_lib_echo "Downloading Adminer, please wait..."
wget --no-check-certificate -cqO /var/www/22222/htdocs/db/adminer/index.php http://downloads.sourceforge.net/adminer/adminer-${EE_ADMINER_VERSION}.php \
|| ee_lib_error "Unable to download Adminer, exit status = " $?
fi
}

25
src/vendor/ee_ven_install_pma.sh

@ -0,0 +1,25 @@
# Install phpMyAdmin
function ee_ven_install_pma()
{
if [ ! -d /var/www/22222/htdocs/db/pma ]
then
# Setup phpMyAdmin
mkdir -p /var/www/22222/htdocs/db/pma/ \
|| ee_lib_error "Unable to create phpMyAdmin directory: /var/www/22222/htdocs/db/pma/, exit status = " $?
# Download phpMyAdmin
ee_lib_echo "Downloading phpMyAdmin, please wait..."
wget --no-check-certificate -cqO /var/www/22222/htdocs/db/pma/pma.tar.gz https://github.com/phpmyadmin/phpmyadmin/archive/STABLE.tar.gz \
|| ee_lib_error "Unable to download phpMyAdmin, exit status = " $?
# Extract phpMyAdmin
tar --strip-components=1 -zxf /var/www/22222/htdocs/db/pma/pma.tar.gz -C /var/www/22222/htdocs/db/pma/ \
|| ee_lib_error "Unable to extract phpMyAdmin, exit status = " $?
# Remove unwanted files
rm -f /var/www/22222/htdocs/db/pma/pma.tar.gz
fi
}

21
src/vendor/ee_ven_install_wp_cli.sh

@ -0,0 +1,21 @@
# Install wp-cli
function ee_ven_install_wp_cli()
{
if [ ! -d /usr/share/wp-cli ]
then
ee_lib_echo "Installing WP-CLI, please wait..."
curl -sL https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh | INSTALL_DIR='/usr/share/wp-cli' VERSION=$EE_WPCLI_VERSION bash &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to install WP-CLI, exit status = " $?
# Add WP-CLI command in $PATH variable
if [ ! -L /usr/bin/wp ]; then
ln -s /usr/share/wp-cli/bin/wp /usr/bin/wp \
|| ee_lib_error "Unable to create symbolic link for WP-CLI command, exit status = " $?
fi
# Auto completion for WP-CLI
cp /usr/share/wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash /etc/bash_completion.d/
source /etc/bash_completion.d/wp-completion.bash
fi
}
Loading…
Cancel
Save