Version to install must be given on the command line.

This commit is contained in:
2017-10-12 03:43:34 +02:00
parent 52ffac83fe
commit ace5fa37bd
2 changed files with 376 additions and 12 deletions

View File

@@ -3,14 +3,10 @@
clear
echo -e "\n\t\033[32mStart script for installation Roundcube Webmailer..\033[m"
## ===================================================================
## - Install Postfixadmin
## ===================================================================
## -----------------------------------------------------------------
## ----------------------------------------------------------------
## ---
## --- For configurations see file conf/install_roundcube.conf
## --- For configurations see file conf/install_upgrade_roundcube.conf
## ---
## --- Dont make changes here!
## ---
@@ -24,7 +20,7 @@ echo -e "\n\t\033[32mStart script for installation Roundcube Webmailer..\033[m"
_src_base_dir="$(realpath $(dirname $0))"
#_src_base_dir=/usr/local/src/postfixadmin
conf_file="${_src_base_dir}/conf/install_roundcube.conf"
conf_file="${_src_base_dir}/conf/install_upgrade_roundcube.conf"
curdir=`pwd`
log_file="$(mktemp)"
@@ -107,6 +103,24 @@ else
echo_ok
fi
echo -e "\033[32m--\033[m"
echo ""
echo "Version of the Roundcube Webmailer to install"
echo ""
echo ""
ROUNDCUBE_VERSION=
while [ "X$ROUNDCUBE_VERSION" = "X" ]
do
echononl "Roundcube Version: "
read ROUNDCUBE_VERSION
if [ "X$ROUNDCUBE_VERSION" = "X" ]; then
echo -e "\n\t\033[33m\033[1mA version number is required!\033[m\n"
fi
done
echo ""
echo -e "\033[32m--\033[m"
echo ""
# - Default values
# -
@@ -278,18 +292,18 @@ fi
# - Determin PHP of all installed versions
# -
echononl "\tGet major numbers of all installed PHP versions"
echononl "\tGet major version of all installed PHP versions"
php_major_versions=`find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort`
if [[ -z "$php_major_versions" ]]; then
echo_failed
error "Getting major numbers of installed PHP versions failed! No installed PHP versiond found!"
error "Getting major version of installed PHP versions failed! No installed PHP versiond found!"
else
echo_ok
fi
# - Get the latest PHP version
# -
echononl "\tGet major number of latest installed PHP version"
echononl "\tGet major version of latest installed PHP version"
php_latest_ver=""
if [[ -n "$php_major_versions" ]]; then
for _ver in $php_major_versions ; do
@@ -304,7 +318,7 @@ if [[ -n "$php_major_versions" ]]; then
echo_ok
else
echo_skipped
warn "Getting major number of latest installed PHP version failed! - No installed PHP versiond found!"
warn "Getting major version of latest installed PHP version failed! - No installed PHP versiond found!"
fi
echo ""
@@ -1441,7 +1455,7 @@ echo -e "\n\n\t\033[37m\033[1mSetup Database '$DB_TYPE'..\033[m\n"
if [[ "$DB_TYPE" = "mysql" ]]; then
if ! mysql $MYSQL_CREDENTIALS -N -s -e \
"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$DB_NAME'" 2>> $log_file \
| grep $POSTFIX_DB_NAME >> $log_file 2>&1 ; then
| grep $DB_NAME >> $log_file 2>&1 ; then
database_exists=false
else
database_exists=true
@@ -1515,7 +1529,7 @@ if $database_exists ; then
fi
elif [[ "$DB_TYPE" = "pgsql" ]]; then
echo -n " (PostgreSQL).."
su - postgres -c "pg_dump $DB_NAME" > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date.sql 2> $log_file
su - postgres -c "pg_dump -c $DB_NAME" > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date.sql 2> $log_file
if [[ $? -eq 0 ]]; then
echo_ok
else