summaryrefslogtreecommitdiff
path: root/mail/mailagent/scripts
diff options
context:
space:
mode:
authoritojun <itojun@pkgsrc.org>1999-12-26 17:25:16 +0000
committeritojun <itojun@pkgsrc.org>1999-12-26 17:25:16 +0000
commit11d5fee0f8ee62adbcdcdaaa48b67a75c216934e (patch)
treecd45821061b92896f53344fabf7861f586ec0ad8 /mail/mailagent/scripts
parenteb4aecbc0c05a268f1297ce3d71dcab451831c0d (diff)
downloadpkgsrc-11d5fee0f8ee62adbcdcdaaa48b67a75c216934e.tar.gz
mail/mailagent from freebsd-current
Diffstat (limited to 'mail/mailagent/scripts')
-rwxr-xr-xmail/mailagent/scripts/pre-configure37
1 files changed, 37 insertions, 0 deletions
diff --git a/mail/mailagent/scripts/pre-configure b/mail/mailagent/scripts/pre-configure
new file mode 100755
index 00000000000..a08a67bcb6b
--- /dev/null
+++ b/mail/mailagent/scripts/pre-configure
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Pre-configure script for mailagent.
+# This script asks for information specific to the machine and writes
+# given values to work/mailagent-3.0/config.sh to set the default
+# values for COnfigure script so that Configure doesn't request any
+# input.
+
+while [ X$addr = X ]; do
+ read -p "Enter your complete E-mail address> " addr
+done
+
+while [ X$host = X ]; do
+ read -p "Enter fully qualified name of this host (`hostname`)> " host
+ if [ X$host = X ]; then
+ host=`hostname`
+ fi
+done
+
+maildomain=`echo $addr | awk -F@ '{printf("%s", $2)}'`
+if [ `echo $maildomain | tr A-Z a-z` = `echo $host | tr A-Z a-z` ]; then
+ d_hidnet=undef
+ hiddennet=''
+else
+ d_hidnet=define
+ hiddennet=$maildomain
+fi
+
+read -p "Enter the name of your organization> " orgname
+
+cat >${WRKSRC}/config.sh <<EOM
+#!/bin/sh
+cf_email='$addr'
+d_flockonly='define'
+d_hidnet='$d_hidnet'
+hiddennet='$hiddennet'
+orgname='$orgname'
+EOM