aboutsummaryrefslogtreecommitdiff
path: root/network/ssmtp/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'network/ssmtp/doinst.sh')
-rw-r--r--network/ssmtp/doinst.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/network/ssmtp/doinst.sh b/network/ssmtp/doinst.sh
index a96179b56e..ec579a9543 100644
--- a/network/ssmtp/doinst.sh
+++ b/network/ssmtp/doinst.sh
@@ -1,5 +1,17 @@
-if [ ! -e /usr/sbin/sendmail ];then
- ln -s ssmtp /usr/sbin/sendmail
-else
- echo '/usr/sbin/sendmail already exists!'
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/ssmtp/revaliases.new
+config etc/ssmtp/ssmtp.conf.new
+
+# If there's no sendmail link, take over:
+if [ ! -r usr/sbin/sendmail ]; then
+ ( cd usr/sbin ; ln -sf ssmtp sendmail )
fi