From 6c45465ae998a78cd0fe3583d2bc4d706754bfb4 Mon Sep 17 00:00:00 2001 From: Andy Witter Date: Fri, 31 May 2013 15:06:56 -0400 Subject: [PATCH] Create function to pre-configure Postfix. --- GenaSYS.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/GenaSYS.sh b/GenaSYS.sh index 7586bd7..7b36cf1 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -26,7 +26,7 @@ SYNOPSIS_="$NAME_" REQUIRES_="standard GNU commands, apt, dpkg" VERSION_="1.11" - DATE_="2010-09-18; last update: 2013-05-30" + DATE_="2010-09-18; last update: 2013-05-31" AUTHOR_="Andy Witter " URL_="http://evergreen-ils.org" CATEGORY_="devel" @@ -1243,6 +1243,13 @@ cp -f "$TEMPLATEDIR/ntp.conf" $TMPFOLDER cp -f "$TEMPLATEDIR/resolv.conf" $TMPFOLDER sed -i "s^CLUSTER_DOMAIN_NAME^$CLUSTERDOMAINNAME^g" "$TMPFOLDER/resolv.conf" +### Preconfigure Postfix for all nodes running postfix +Prep_Postfix () { ### Usage $0 +cp -f "$TEMPLATEDIR/postfix.debconf" "$TMPFOLDER" +sed -i "s^HOSTNAME^$1^g" "$TMPFOLDER/postfix.debconf" +sed -i "s^CLUSTER_DOMAIN_NAME^$CLUSTERDOMAINNAME^g" "$TMPFOLDER/postfix.debconf" +} + ### Begin setup exports [ -e $TMPFOLDER/exports ] && rm -f $TMPFOLDER/exports [ -e $TMPFOLDER/exports_reporter ] && rm -f $TMPFOLDER/exports_reporter @@ -2577,9 +2584,13 @@ fi if echo ${NODE_FOLDER} | grep -q lvs0 then cp -f $TEMPLATEDIR/lvs/ldirector*.deb "setup_${NODE_FOLDER}" + Prep_Postfix ${NODE_FOLDER} + mv -f $TMPFOLDER/postfix.debconf "setup_${NODE_FOLDER}" fi if echo ${NODE_FOLDER} | grep -q monitor0 then + Prep_Postfix ${NODE_FOLDER} + mv -f $TMPFOLDER/postfix.debconf "setup_${NODE_FOLDER}" mkdir "setup_${NODE_FOLDER}/Icinga-Nagios" cp -f "$TEMPLATEDIR/monitor/commands.cfg" "setup_${NODE_FOLDER}/Icinga-Nagios" cp -f "$TMPFOLDER/hosts.cfg" "setup_${NODE_FOLDER}/Icinga-Nagios" -- 2.11.0