head	1.4;
access;
symbols
	perseant-exfatfs-base-20250801:1.4
	perseant-exfatfs-base-20240630:1.4
	cjep_sun2x:1.4.0.44
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	cjep_staticlib_x:1.4.0.42
	cjep_staticlib_x-base:1.4
	phil-wifi-20200421:1.4
	phil-wifi-20200411:1.4
	phil-wifi-20200406:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	pgoyette-compat-0728:1.4
	pgoyette-compat-0625:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	pgoyette-compat:1.4.0.40
	pgoyette-compat-base:1.4
	perseant-stdc-iso10646:1.4.0.38
	perseant-stdc-iso10646-base:1.4
	prg-localcount2-base3:1.4
	prg-localcount2-base2:1.4
	prg-localcount2-base1:1.4
	prg-localcount2:1.4.0.36
	prg-localcount2-base:1.4
	pgoyette-localcount-20170426:1.4
	bouyer-socketcan-base1:1.4
	pgoyette-localcount-20170320:1.4
	bouyer-socketcan:1.4.0.34
	bouyer-socketcan-base:1.4
	pgoyette-localcount-20170107:1.4
	pgoyette-localcount-20161104:1.4
	localcount-20160914:1.4
	pgoyette-localcount-20160806:1.4
	pgoyette-localcount-20160726:1.4
	pgoyette-localcount:1.4.0.32
	pgoyette-localcount-base:1.4
	netbsd-5-2-3-RELEASE:1.4
	netbsd-5-1-5-RELEASE:1.4
	yamt-pagecache-base9:1.4
	yamt-pagecache-tag8:1.4
	tls-earlyentropy:1.4.0.28
	tls-earlyentropy-base:1.4
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4
	riastradh-drm2-base3:1.4
	netbsd-5-2-2-RELEASE:1.4
	netbsd-5-1-4-RELEASE:1.4
	netbsd-5-2-1-RELEASE:1.4
	netbsd-5-1-3-RELEASE:1.4
	agc-symver:1.4.0.30
	agc-symver-base:1.4
	tls-maxphys-base:1.4
	yamt-pagecache-base8:1.4
	netbsd-5-2:1.4.0.26
	yamt-pagecache-base7:1.4
	netbsd-5-2-RELEASE:1.4
	netbsd-5-2-RC1:1.4
	yamt-pagecache-base6:1.4
	yamt-pagecache-base5:1.4
	yamt-pagecache-base4:1.4
	netbsd-5-1-2-RELEASE:1.4
	netbsd-5-1-1-RELEASE:1.4
	yamt-pagecache-base3:1.4
	yamt-pagecache-base2:1.4
	yamt-pagecache:1.4.0.24
	yamt-pagecache-base:1.4
	bouyer-quota2-nbase:1.4
	bouyer-quota2:1.4.0.22
	bouyer-quota2-base:1.4
	matt-nb5-pq3:1.4.0.20
	matt-nb5-pq3-base:1.4
	netbsd-5-1:1.4.0.18
	netbsd-5-1-RELEASE:1.4
	netbsd-5-1-RC4:1.4
	netbsd-5-1-RC3:1.4
	netbsd-5-1-RC2:1.4
	netbsd-5-1-RC1:1.4
	netbsd-5-0-2-RELEASE:1.4
	netbsd-5-0-1-RELEASE:1.4
	jym-xensuspend-nbase:1.4
	netbsd-5-0:1.4.0.16
	netbsd-5-0-RELEASE:1.4
	netbsd-5-0-RC4:1.4
	netbsd-5-0-RC3:1.4
	netbsd-5-0-RC2:1.4
	jym-xensuspend:1.4.0.14
	jym-xensuspend-base:1.4
	netbsd-5-0-RC1:1.4
	netbsd-5:1.4.0.12
	netbsd-5-base:1.4
	yamt-pf42-base4:1.4
	yamt-pf42-base3:1.4
	hpcarm-cleanup-nbase:1.4
	yamt-pf42-base2:1.4
	yamt-pf42:1.4.0.10
	yamt-pf42-base:1.4
	mjf-devfs2:1.4.0.8
	mjf-devfs2-base:1.4
	keiichi-mipv6-nbase:1.4
	keiichi-mipv6:1.4.0.6
	keiichi-mipv6-base:1.4
	cube-autoconf:1.4.0.4
	cube-autoconf-base:1.4
	hpcarm-cleanup:1.4.0.2
	hpcarm-cleanup-base:1.4
	netbsd-3-1-1-RELEASE:1.3
	netbsd-3-0-3-RELEASE:1.3
	netbsd-3-1:1.3.0.6
	netbsd-3-1-RELEASE:1.3
	netbsd-3-0-2-RELEASE:1.3
	netbsd-3-1-RC4:1.3
	netbsd-3-1-RC3:1.3
	netbsd-3-1-RC2:1.3
	netbsd-3-1-RC1:1.3
	netbsd-3-0-1-RELEASE:1.3
	netbsd-3-0:1.3.0.4
	netbsd-3-0-RELEASE:1.3
	netbsd-3-0-RC6:1.3
	netbsd-3-0-RC5:1.3
	netbsd-3-0-RC4:1.3
	netbsd-3-0-RC3:1.3
	netbsd-3-0-RC2:1.3
	netbsd-3-0-RC1:1.3
	netbsd-2-0-3-RELEASE:1.2
	netbsd-2-1:1.2.0.6
	netbsd-2-1-RELEASE:1.2
	netbsd-2-1-RC6:1.2
	netbsd-2-1-RC5:1.2
	netbsd-2-1-RC4:1.2
	netbsd-2-1-RC3:1.2
	netbsd-2-1-RC2:1.2
	netbsd-2-1-RC1:1.2
	netbsd-2-0-2-RELEASE:1.2
	netbsd-3:1.3.0.2
	netbsd-3-base:1.3
	netbsd-2-0-1-RELEASE:1.2
	netbsd-2:1.2.0.4
	netbsd-2-base:1.2
	netbsd-2-0-RELEASE:1.2
	netbsd-2-0-RC5:1.2
	netbsd-2-0-RC4:1.2
	netbsd-2-0-RC3:1.2
	netbsd-2-0-RC2:1.2
	netbsd-2-0-RC1:1.2
	netbsd-2-0:1.2.0.2
	netbsd-2-0-base:1.2
	netbsd-1-6-PATCH002-RELEASE:1.1
	netbsd-1-6-PATCH002:1.1
	netbsd-1-6-PATCH002-RC4:1.1
	netbsd-1-6-PATCH002-RC3:1.1
	netbsd-1-6-PATCH002-RC2:1.1
	netbsd-1-6-PATCH002-RC1:1.1
	netbsd-1-6-PATCH001:1.1
	netbsd-1-6-PATCH001-RELEASE:1.1
	netbsd-1-6-PATCH001-RC3:1.1
	netbsd-1-6-PATCH001-RC2:1.1
	netbsd-1-6-PATCH001-RC1:1.1
	fvdl_fs64_base:1.1
	netbsd-1-6-RELEASE:1.1
	netbsd-1-6-RC3:1.1
	netbsd-1-6-RC2:1.1
	netbsd-1-6-RC1:1.1
	netbsd-1-6:1.1.0.2
	netbsd-1-6-base:1.1;
locks; strict;
comment	@# @;


1.4
date	2006.02.08.00.47.33;	author christos;	state dead;
branches;
next	1.3;

1.3
date	2005.01.18.18.12.55;	author peter;	state Exp;
branches;
next	1.2;

1.2
date	2004.03.09.21.36.37;	author garbled;	state Exp;
branches;
next	1.1;

1.1
date	2001.03.06.21.21.06;	author garbled;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Bye bye sushi config files (moved to othersrc via repository copy)
@
text
@#!/bin/sh
# $NetBSD: script,v 1.3 2005/01/18 18:12:55 peter Exp $

BACKUPDIR="/var/sushi"
MAILERCONF="/etc/mailer.conf"
BACKUP="${BACKUPDIR}/mailer.conf"

if [ ! -d $BACKUPDIR ]; then
	mkdir $BACKUPDIR
	chown root:wheel $BACKUPDIR
	chmod 700 $BACKUPDIR
fi

# create a backup
cp -p $MAILERCONF $BACKUP
if [ $? -ne 0 ]; then
	echo "Can't create a backup"
	exit 1
fi

if [ "$1" = "sendmail" ]; then
	sendmail=0
	grep sendmail/sendmail $MAILERCONF >/dev/null
	if [ $? -eq 0 ]; then
		grep "^#.*sendmail/sendmail" $MAILERCONF >/dev/null
		if [ $? -ne 0 ]; then
			sendmail=1
		fi
	fi

	if [ $sendmail -eq 1 ]; then
		echo "Sendmail is already 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
	chown root:wheel $MAILERCONF
	chmod 644 $MAILERCONF
	echo "Sendmail has now been made your default mailer."
	exit 0
fi

if [ "$1" = "postfix" ]; then
	postfix=0
	grep postfix/sendmail $MAILERCONF >/dev/null
	if [ $? -eq 0 ]; then
		grep "^#.*postfix/sendmail" $MAILERCONF >/dev/null
		if [ $? -ne 0 ]; then
			postfix=1
		fi
	fi

	if [ $postfix -eq 1 ]; then
		echo "Postfix is already 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
	chown root:wheel $MAILERCONF
	chmod 644 $MAILERCONF
	echo "Postfix has now been made your default mailer."
	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
@


1.3
log
@Minor cleanup and tweaks, be consistent with the other system admin scripts.
@
text
@d2 1
a2 1
# $NetBSD: script,v 1.2 2004/03/09 21:36:37 garbled Exp $
@


1.2
log
@Apply patches in PR bin/24645 by Peter Postma:
	Here are some enhancements to sushi's System Maintenance menu.
	To summarize the changes:

	* Make a backup of the file before modifying it.
	* Fixes to get all menus/forms working.
	* Missing/invalid settings (like in rc.conf and inetd.conf)
	  have been added/removed.
	* Most files don't get overwritten now but are edited instead.
	  So specials settings in e.g. /etc/rc.conf don't get lost now.
	* Some help menu fixes. ($NetBSD$ tag has been removed because I
	  don't see how it would be useful for either user or developer).
@
text
@d2 1
a2 1
# $NetBSD: script,v 1.1 2001/03/06 21:21:06 garbled Exp $
d14 1
a14 1
# backup
d16 4
d32 1
a32 1
		echo "Sendmail is already your default mailer"
d58 1
a58 1
		echo "Postfix is already your default mailer"
d77 1
a77 1
	echo "$PKGNM has now been made your default mailer"
d87 1
a87 1
	echo "$PKGNM has now been made your default mailer"
d97 1
a97 1
	echo "$PKGNM has now been made your default mailer"
@


1.1
log
@Add scripts to edit your /etc/mailer.conf file.  Currently it can also deal
with the exim/sendmail88 and postfix-current packages.
@
text
@d2 1
a2 1
# $NetBSD$
d4 1
d6 10
d18 1
d20 9
a28 2
	if [ "$?" = "0" ]; then
		echo "Sendmail is allready your default mailer"
a36 1
	echo "Sendmail has now been made your default mailer."
d39 1
d44 1
d46 9
a54 2
	if [ "$?" = "0" ]; then
		echo "Postfix is allready your default mailer"
a60 1
	echo "Postfix has now been made your default mailer."
d63 1
@

