[pve-devel] [PATCH manager 08/15] postinst: simplify root's mail .forward check

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 24 14:12:33 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 debian/postinst | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 518eeff6..2d897d89 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -56,12 +56,7 @@ EOF
 	pveam update || true
     fi
 
-    if test -f /root/.forward; then
-	if ! grep -q '|/usr/bin/pvemailforward' /root/.forward; then 
-	    echo -e "|/usr/bin/pvemailforward\n$(cat /root/.forward)" >/root/.forward.tmp
-	    mv /root/.forward.tmp /root/.forward
-	fi
-    else
+    if ! test -f /root/.forward || ! grep -q '|/usr/bin/pvemailforward' /root/.forward; then
 	echo '|/usr/bin/pvemailforward' >/root/.forward
     fi
 
-- 
2.14.2





More information about the pve-devel mailing list