Add scripts to edit your /etc/mailer.conf file. Currently it can also deal

with the exim/sendmail88 and postfix-current packages.
This commit is contained in:
garbled 2001-03-06 21:21:06 +00:00
parent ec637bec44
commit a3e0c8a6d8
4 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/03/06 21:21:06 garbled Exp $
FILES= form
FILESDIR=${BINDIR}/sushi/system/mailerconf
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/system/mailerconf
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/03/06 21:21:06 garbled Exp $
script:script1 Please select your default mail agent

View File

@ -0,0 +1,68 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:21:06 garbled Exp $
MAILERCONF="/etc/mailer.conf"
if [ "$1" = "sendmail" ]; then
grep sendmail/sendmail $MAILERCONF >/dev/null
if [ "$?" = "0" ]; then
echo "Sendmail is allready your default mailer"
exit 0
fi
echo "sendmail /usr/libexec/sendmail/sendmail" >$MAILERCONF
echo "send-mail /usr/libexec/sendmail/sendmail" >>$MAILERCONF
echo "mailq /usr/libexec/sendmail/sendmail" >>$MAILERCONF
echo "newaliases /usr/libexec/sendmail/sendmail" >>$MAILERCONF
echo "hoststat /usr/libexec/sendmail/sendmail" >>$MAILERCONF
echo "purgestat /usr/libexec/sendmail/sendmail" >>$MAILERCONF
echo "Sendmail has now been made your default mailer."
chown root:wheel $MAILERCONF
chmod 644 $MAILERCONF
exit 0
fi
if [ "$1" = "postfix" ]; then
grep postfix/sendmail $MAILERCONF >/dev/null
if [ "$?" = "0" ]; then
echo "Postfix is allready your default mailer"
exit 0
fi
echo "sendmail /usr/libexec/postfix/sendmail" >$MAILERCONF
echo "send-mail /usr/libexec/postfix/sendmail" >>$MAILERCONF
echo "mailq /usr/libexec/postfix/sendmail" >>$MAILERCONF
echo "newaliases /usr/libexec/postfix/sendmail" >>$MAILERCONF
echo "Postfix has now been made your default mailer."
chown root:wheel $MAILERCONF
chmod 644 $MAILERCONF
exit 0
fi
if [ "$1" = "exim" ]; then
PKGNM=`pkg_info -e exim`
LOCALBASE=`pkg_info -p $PKGNM | grep CWD | sed -e 's@.*CWD to: @@'`
cp $LOCALBASE/etc/exim/mailer.conf.exim $MAILERCONF
chown root:wheel $MAILERCONF
chmod 644 $MAILERCONF
echo "$PKGNM has now been made your default mailer"
exit 0
fi
if [ "$1" = "postfix-current" ]; then
PKGNM=`pkg_info -e postfix-current`
LOCALBASE=`pkg_info -p $PKGNM | grep CWD | sed -e 's@.*CWD to: @@'`
cp $LOCALBASE/etc/mailer.conf.postfix $MAILERCONF
chown root:wheel $MAILERCONF
chmod 644 $MAILERCONF
echo "$PKGNM has now been made your default mailer"
exit 0
fi
if [ "$1" = "sendmail88" ]; then
PKGNM=`pkg_info -e sendmail88`
LOCALBASE=`pkg_info -p $PKGNM | grep CWD | sed -e 's@.*CWD to: @@'`
cp $LOCALBASE/etc/mailer.conf.sendmail $MAILERCONF
chown root:wheel $MAILERCONF
chmod 644 $MAILERCONF
echo "$PKGNM has now been made your default mailer"
exit 0
fi

View File

@ -0,0 +1,22 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/03/06 21:21:07 garbled Exp $
grep sendmail/sendmail /etc/mailer.conf >/dev/null
if [ "$?" = "0" ]; then
echo "sendmail"
echo "postfix"
fi
grep postfix/sendmail /etc/mailer.conf >/dev/null
if [ "$?" = "0" ]; then
echo "postfix"
echo "sendmail"
fi
for i in $BIGLIST
do
pkg_info -e $i >/dev/null
if [ "$?" = "0" ]; then
echo "$i"
fi
done