#!/bin/sh

# Written by Gerben Wierda, Oct 2001. I waive every copyright on this and
# I also do not give any warranty.

. ./defines

. ./deactivate-postfix

# Activate binaries
if [ ! -e ${SENDMAILBACKUPDIR}/sendmail ]
then
	echo "Something is wrong: there is no existing sendmail binary backup"
	exit 1;
else
	echo "Restoring sendmail versions of sendmail programs from backup..."
	(cd ${SENDMAILBACKUPDIR}; tar cf - sendmail) | (cd /usr/sbin; tar xf -) 
	(cd ${SENDMAILBACKUPDIR}; tar cf - newaliases) | (cd /usr/bin; tar xf -) 
	(cd ${SENDMAILBACKUPDIR}; tar cf - mailq) | (cd /usr/bin; tar xf -)
fi

# Activate sendmail in /etc/hostconfig
/usr/bin/perl -pi -e 's/MAILSERVER=-NO-/MAILSERVER=-YES-/g' /etc/hostconfig

