12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #! /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
-
- if [ ! -e /etc/opendkim/keys/dkim.private ]
- then
- cd /etc/opendkim/keys &&
- opendkim-genkey -s dkim -d "${MAIL_DOMAIN}" &&
- chown opendkim:opendkim dkim.private dkim.txt
- cd --
- fi
-
- sleep 5
-
- rm -f /var/run/rsyslogd.pid
- rm -f /var/run/opendkim/opendkim.pid
- service rsyslog start
- service opendkim start &&
- cat /var/log/syslog
|