Create function to pre-configure Postfix.
authorAndy Witter <awitter@georgialibraries.org>
Fri, 31 May 2013 19:06:56 +0000 (15:06 -0400)
committerAndy Witter <awitter@georgialibraries.org>
Fri, 31 May 2013 19:06:56 +0000 (15:06 -0400)
GenaSYS.sh

index 7586bd7..7b36cf1 100755 (executable)
@@ -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 <awitter@georgialibraries.org>"
         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 <hostname>
+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"