1234567891011121314151617181920212223242526272829303132333435363738 |
- #! /usr/bin/env bash
-
- replace_var()
- {
- file="${1}"
- var="${2}"
- sed -e "s?${var}?${!var}?g" -i "${file}"
- }
-
- replace_vars()
- {
- file="${1}"
- for var in $(cat /etc/vars-vars)
- do
- replace_var "${file}" "${var}"
- done
- }
-
- replace_files()
- {
- for file in $(cat /etc/vars-files)
- do
- replace_vars "${file}"
- done
- }
-
- replace_files
-
- sed -e "s/hosts *=.*/hosts = ${POSTGRES_HOST}/g" -i /etc/postfix/pgsql_*
- sed -e "s/user *=.*/user = ${POSTGRES_USER}/g" -i /etc/postfix/pgsql_*
- sed -e "s/password *=.*/password = ${POSTGRES_PASSWORD}/g" -i /etc/postfix/pgsql_*
- sed -e "s/dbname *=.*/dbname = ${POSTGRES_DB}/g" -i /etc/postfix/pgsql_*
-
- rm -f /var/run/rsyslogd.pid
- service rsyslog start &&
- service postfix start &&
-
- cat /var/log/mail.info
|