22 lines
612 B
Bash
22 lines
612 B
Bash
#!/bin/sh
|
|
|
|
if [ -f /etc/mailer.conf.sendmail ]; then
|
|
if [ -f /etc/mailer.conf ]; then
|
|
if mv -f /etc/mailer.conf /etc/mailer.conf.pre-sendmail; then
|
|
echo "old /etc/mailer.conf saved as" \
|
|
"/etc/mailer.conf.pre-sendmail" >&2
|
|
else
|
|
echo "failed to save current mailer.conf" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
if mv -f /etc/mailer.conf.sendmail /etc/mailer.conf; then
|
|
echo "sendmail /etc/mailer.conf enabled" >&2
|
|
else
|
|
echo "failed to enable sendmail in /etc/mailer.conf" >&2
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "can't find /etc/mailer.conf.sendmail, sendmail not enabled" >&2
|
|
exit 1
|
|
fi
|