[28427] in Source-Commits
scripts commit: Further noninteractive enhancements
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Sep 16 10:48:09 2014
Date: Tue, 16 Sep 2014 10:48:02 -0400
From: Jonathan D Reed <jdreed@mit.edu>
Message-Id: <201409161448.s8GEm2Df002930@drugstore.mit.edu>
To: source-commits@mit.edu
https://github.com/mit-athena/scripts/commit/e1ee0054a2cdd392e98ed37035967c3c890cca1f
commit e1ee0054a2cdd392e98ed37035967c3c890cca1f
Author: Jonathan Reed <jdreed@mit.edu>
Date: Mon Sep 15 15:02:05 2014 -0400
Further noninteractive enhancements
Ensure that the msmtp-mta prompt is only displayed for
interactive installs, and that the defaults are sane.
installer/install-debathena.beta.sh | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/installer/install-debathena.beta.sh b/installer/install-debathena.beta.sh
index 20b15e6..38f0bca 100644
--- a/installer/install-debathena.beta.sh
+++ b/installer/install-debathena.beta.sh
@@ -178,23 +178,30 @@ mainpackage=debathena-$category
csoft=no
tsoft=no
resolvconfhack=no
-msmtpmta=no
-if [ cluster = "$category" ]; then
- msmtpmta=yes
-else
+case "$category" in
+ cluster)
+ msmtpmta=yes
+ ;;
+ workstation)
+ msmtpmta=yes
+ maildefault=y
+ mailprompt="[Y/n]"
+ ;;
+ *)
+ msmtpmta=no
+ maildefault=n
+ mailprompt="[y/N]"
+ ;;
+esac
+
+if [ "$unattended" != "yes" ]; then
echo "Debathena provides the 'debathena-msmtp-mta' package, which includes"
echo "a wrapper for the 'sendmail' command that configures it to use the"
echo "MIT outgoing servers and Kerberos authentication."
echo "Advanced users may wish to skip this package and configure their own"
echo "mail transport agent (e.g. Postfix) instead."
echo
- maildefault=n
- mailprompt="[y/N]"
- if [ workstation = "$category" ] ; then
- maildefault=y
- mailprompt="[Y/n]"
- fi
ask "Install debathena-msmtp-mta? $mailprompt" $maildefault
if [ y = "$answer" ]; then
msmtpmta=yes
@@ -252,6 +259,7 @@ fi
echo "A summary of your choices:"
echo " Category: $category"
+echo " msmtp-mta: $msmtpmta"
echo " Extra-software package: $csoft"
echo " Third-party software package: $tsoft"
echo ""