diff --git a/OARiNZ/DIY/webmin-exim/webmin-exim_0.2.6-4.diff b/OARiNZ/DIY/webmin-exim/webmin-exim_0.2.6-4.diff index 294aa58..f93802a 100755 --- a/OARiNZ/DIY/webmin-exim/webmin-exim_0.2.6-4.diff +++ b/OARiNZ/DIY/webmin-exim/webmin-exim_0.2.6-4.diff @@ -243,17 +243,92 @@ +4 --- webmin-exim-0.2.6.orig/debian/webmin-exim.postinst +++ webmin-exim-0.2.6/debian/webmin-exim.postinst -@@ -0,0 +1,13 @@ +@@ -0,0 +1,61 @@ +#!/bin/sh -+set -e ++#set -e + -+if [ "$1" = "configure" -a "$2" != "" ]; then -+ if [ "`dpkg-query -W --showformat='${status}' exim | awk '{ print $3 }'`" = "installed" ]; then -+ ucf --three-way --debconf-ok /usr/share/webmin-exim/exim3.config /etc/webmin/exim/config ++# Find out what version of exim is installed. ++if [ "`dpkg-query -W --showformat='${status}' exim | awk '{ print $3 }'`" = "installed" ]; then ++ version=exim3 ++else ++ version=exim4 ++fi ++if [ "1" = "1" ]; then ++ # Update the ACL for the root user, or the first user in the ACL ++ grep "^root:" /etc/webmin/webmin.acl >/dev/null ++ if [ "$?" = "0" ]; then ++ user=root ++ else ++ user=`head -1 /etc/webmin/webmin.acl | cut -f 1 -d :` ++ fi ++ mods=`grep $user: /etc/webmin/webmin.acl | cut -f 2 -d :` ++ echo $mods | grep " exim" >/dev/null ++ if [ "$?" != "0" ]; then ++ grep -v ^$user: /etc/webmin/webmin.acl > /tmp/webmin.acl.tmp ++ echo $user: $mods exim > /etc/webmin/webmin.acl ++ cat /tmp/webmin.acl.tmp >> /etc/webmin/webmin.acl ++ rm -f /tmp/webmin.acl.tmp ++ fi ++fi ++if [ "$1" = "configure" ]; then ++ # If upgrading, check with user whether to replace config. ++ if [ "$2" != "" ]; then ++ ucf --three-way --debconf-ok /usr/share/webmin-exim/$version.config /etc/webmin/exim/config ++ # Otherwise, just replace it, as this is the first time installed. + else -+ ucf --three-way --debconf-ok /usr/share/webmin-exim/exim4.config /etc/webmin/exim/config ++ cp /usr/share/webmin-exim/$version.config /etc/webmin/exim/config + fi +fi ++if [ "" != "" -a "" = "1" ]; then ++ # Activate this theme ++ grep -v "^preroot=" /etc/webmin/miniserv.conf >/etc/webmin/miniserv.conf.tmp ++ (cat /etc/webmin/miniserv.conf.tmp ; echo preroot=exim) > /etc/webmin/miniserv.conf ++ rm -f /etc/webmin/miniserv.conf.tmp ++ grep -v "^theme=" /etc/webmin/config >/etc/webmin/config.tmp ++ (cat /etc/webmin/config.tmp ; echo theme=exim) > /etc/webmin/config ++ rm -f /etc/webmin/config.tmp ++ (/etc/webmin/stop && /etc/webmin/start) >/dev/null 2>&1 ++fi ++rm -f /etc/webmin/module.infos.cache ++ ++# Run post-install function ++if [ "webmin" = "webmin" ]; then ++ cd /usr/share/webmin ++ WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin /usr/share/webmin/run-postinstalls.pl exim ++fi ++ ++# Run post-install shell script ++if [ -r "/usr/share/webmin/exim/postinstall.sh" ]; then ++ cd /usr/share/webmin ++ WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin /usr/share/webmin/exim/postinstall.sh ++fi ++ ++#DEBHELPER# ++ +--- webmin-exim-0.2.6.orig/debian/webmin-exim.prerm ++++ webmin-exim-0.2.6/debian/webmin-exim.prerm +@@ -0,0 +1,24 @@ ++#!/bin/sh ++#set -e ++ ++# De-activate this theme, if in use and if we are not upgrading ++if [ "" = "1" -a "$1" != "upgrade" ]; then ++ grep "^preroot=exim" /etc/webmin/miniserv.conf >/dev/null ++ if [ "$?" = "0" ]; then ++ grep -v "^preroot=exim" /etc/webmin/miniserv.conf >/etc/webmin/miniserv.conf.tmp ++ (cat /etc/webmin/miniserv.conf.tmp) > /etc/webmin/miniserv.conf ++ rm -f /etc/webmin/miniserv.conf.tmp ++ grep -v "^theme=exim" /etc/webmin/config >/etc/webmin/config.tmp ++ (cat /etc/webmin/config.tmp) > /etc/webmin/config ++ rm -f /etc/webmin/config.tmp ++ (/etc/webmin/stop && /etc/webmin/start) >/dev/null 2>&1 ++ fi ++fi ++# Run the pre-uninstall script, if we are not upgrading ++if [ "webmin" = "webmin" -a "$1" = "0" -a -r "/usr/share/webmin/exim/uninstall.pl" ]; then ++ cd /usr/share/webmin ++ WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin /usr/share/webmin/run-uninstalls.pl exim ++fi + +#DEBHELPER# +