install_postfixadmin.sh: change default value for db host if database type is MySQL. Replace variable 'POSTFIX_DB_HOST'/'POSTFIX_DB_SOCKET' with 'POSTFIX_DB_HOST_MYSQL' / 'POSTFIX_DB_HOST_PGSQL'.
This commit is contained in:
parent
24a06802f6
commit
fabc15356a
@ -218,19 +218,28 @@ D-10999 Berlin | E-MAIL: oo@oopen.de
|
||||
# -
|
||||
POSTFIX_DB_TYPE="pgsql"
|
||||
|
||||
# - Host of Postfix Database
|
||||
# - Host/Socket of Postfix Database (MySQL)
|
||||
# -
|
||||
# - Defaults to 'localhost'
|
||||
# - Example:
|
||||
# - POSTFIX_DB_HOST_MYSQL="127.0.0.1"
|
||||
# - POSTFIX_DB_HOST_MYSQL="unix:/tmp/mysql.sock"
|
||||
# -
|
||||
#POSTFIX_DB_HOST=""
|
||||
# - Note:
|
||||
# - Dont't use 'localhost' if your MySQL socket is NOT
|
||||
# - located at '/var/run/mysqld/mysqld.sock'
|
||||
# -
|
||||
# - Defaults to 'unix:/tmp/mysql.sock'
|
||||
# -
|
||||
#POSTFIX_DB_HOST_MYSQL=""
|
||||
|
||||
# - Unix socket where PostgreSQL is listening
|
||||
# - Host/Socket of Postfix Database (PostgeSQL)
|
||||
# -
|
||||
# - Only possible, for postgreSQL
|
||||
# - Example:
|
||||
# - POSTFIX_DB_HOST_PGSQL='/var/run/postgresql'
|
||||
# -
|
||||
# - Defaults to '/var/run/postgresql'
|
||||
# -
|
||||
#POSTFIX_DB_SOCKET=""
|
||||
#POSTFIX_DB_HOST_PGSQL=""
|
||||
|
||||
# - Name of Postfix Database
|
||||
# -
|
||||
|
@ -220,10 +220,10 @@ DEFAULT_APACHE_SERVER_CERT="server-bundle.crt"
|
||||
DEFAULT_APACHE_SERVER_KEY="server.key"
|
||||
DEFAULT_DEBIAN_APACHE_VHOST_DIR="/etc/apache2/sites-available"
|
||||
DEFAULT_APACHE_VHOST_DIR="/usr/local/apache2/conf/vhosts"
|
||||
DEFAULT_POSTFIX_DB_HOST="localhost"
|
||||
DEFAULT_POSTFIX_DB_HOST_PGSQL="/var/run/postgresql"
|
||||
DEFAULT_POSTFIX_DB_HOST_MYSQL="unix:/tmp/mysql.sock"
|
||||
DEFAULT_POSTFIX_DB_NAME="postfix"
|
||||
DEFAULT_POSTFIX_DB_USER="postfix"
|
||||
DEFAULT_POSTFIX_DB_SOCKET_PG="/var/run/postgresql"
|
||||
DEFAULT_DEBIAN_MYSQL_CREDENTIALS="--defaults-file=/etc/mysql/debian.cnf"
|
||||
DEFAULT_MYSQL_CREDENTIALS="--defaults-file=/usr/local/mysql/sys-maint.cnf"
|
||||
|
||||
@ -320,19 +320,12 @@ fi
|
||||
|
||||
|
||||
[[ -n "$POSTFIX_DB_TYPE" ]] || fatal "Database Type of Postfix Database (POSTFIX_DB_TYPE) not present!"
|
||||
[[ -n "$POSTFIX_DB_HOST" ]] || POSTFIX_DB_HOST="$DEFAULT_POSTFIX_DB_HOST"
|
||||
[[ -n "$POSTFIX_DB_HOST_MYSQL" ]] || POSTFIX_DB_HOST_MYSQL="$DEFAULT_POSTFIX_DB_HOST_MYSQL"
|
||||
[[ -n "$POSTFIX_DB_HOST_PGSQL" ]] ||POSTFIX_DB_HOST_PGSQL="$DEFAULT_POSTFIX_DB_HOST_PGSQL"
|
||||
[[ -n "$POSTFIX_DB_NAME" ]] || POSTFIX_DB_NAME="$DEFAULT_POSTFIX_DB_NAME"
|
||||
[[ -n "$POSTFIX_DB_USER" ]] || POSTFIX_DB_USER="$DEFAULT_POSTFIX_DB_USER"
|
||||
[[ -n "$POSTFIX_DB_PASS" ]] || fatal "Password of Postfix Database (POSTFIX_DB_PASS) not given!"
|
||||
|
||||
if [[ -n "$POSTFIX_DB_SOCKET" ]]; then
|
||||
if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then
|
||||
fatal "MySQL Socket (POSTFIX_DB_SOCKET) is not supported by this script"
|
||||
fi
|
||||
else
|
||||
POSTFIX_DB_SOCKET="$DEFAULT_POSTFIX_DB_SOCKET_PG"
|
||||
fi
|
||||
|
||||
[[ -n "$MYSQL_DEBIAN_INSTALLATION" ]] || MYSQL_DEBIAN_INSTALLATION=false
|
||||
|
||||
if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then
|
||||
@ -440,10 +433,11 @@ echo ""
|
||||
if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then
|
||||
echo -e "\tDatabase type of Postfix Database....: MySQL"
|
||||
echo -e "\tMySQL from Debian Package System.....: $MYSQL_DEBIAN_INSTALLATION"
|
||||
echo -e "\tHost of Postfix Database.............: $POSTFIX_DB_HOST_MYSQL"
|
||||
else
|
||||
echo -e "\tDatabase type of Postfix Database....: PostgreSQL"
|
||||
echo -e "\tHost of Postfix Database.............: $POSTFIX_DB_HOST_PGSQL"
|
||||
fi
|
||||
echo -e "\tHost of Postfix Database.............: $POSTFIX_DB_HOST"
|
||||
echo -e "\tName of Postfix Database.............: $POSTFIX_DB_NAME"
|
||||
echo -e "\tUser of Postfix Database.............: $POSTFIX_DB_USER"
|
||||
echo -e "\tPassword of Postfix Database.........: $POSTFIX_DB_PASS"
|
||||
@ -2519,7 +2513,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_relay-domain-maps.cf'"
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_relay-domain-maps.cf 2> $log_file
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2529,7 +2523,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_relay-domain-maps.cf 2> $log_file
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2571,7 +2565,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_sender_login_maps.cf'"
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_sender_login_maps.cf 2> $log_file
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2581,7 +2575,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_sender_login_maps.cf 2> $log_file
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2624,7 +2618,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_transport_maps.cf'"
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_transport_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2637,7 +2631,7 @@ EOF
|
||||
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_transport_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2685,7 +2679,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_maps.cf'"
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2695,7 +2689,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2716,7 +2710,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_ma
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2726,7 +2720,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2746,7 +2740,7 @@ fi
|
||||
echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_catchall_maps.cf'"
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_catchall_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2756,7 +2750,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_catchall_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2804,7 +2798,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_mailbox_maps.cf
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_mailbox_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2814,7 +2808,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_mailbox_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2835,7 +2829,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_ma
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_mailbox_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2845,7 +2839,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_domain_mailbox_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2889,7 +2883,7 @@ echononl "\tCreate file '/etc/postfix/${POSTFIX_DB_TYPE}_virtual_domains_maps.cf
|
||||
if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_domains_maps.cf
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2899,7 +2893,7 @@ EOF
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_domains_maps.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2946,7 +2940,7 @@ if [ "$POSTFIX_DB_TYPE" = "pgsql" ]; then
|
||||
## - this address rewriting acts as address extension
|
||||
## - with delimeter "-"
|
||||
## -
|
||||
hosts = $POSTFIX_DB_SOCKET
|
||||
hosts = $POSTFIX_DB_HOST_PGSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
@ -2955,7 +2949,7 @@ EOF
|
||||
|
||||
elif [ "$POSTFIX_DB_TYPE" = "mysql" ];then
|
||||
cat <<EOF > /etc/postfix/${POSTFIX_DB_TYPE}_virtual_alias_address_rewriting.cf
|
||||
hosts = $POSTFIX_DB_HOST
|
||||
hosts = $POSTFIX_DB_HOST_MYSQL
|
||||
user = $POSTFIX_DB_USER
|
||||
password = $POSTFIX_DB_PASS
|
||||
dbname = $POSTFIX_DB_NAME
|
||||
|
Loading…
Reference in New Issue
Block a user