postinst: simplify root's mail .forward check

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-03-12 14:13:59 +01:00 committed by Fabian Grünbichler
parent b0e70271e5
commit 544221fa8a

9
debian/postinst vendored
View File

@ -58,13 +58,8 @@ 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
echo '|/usr/bin/pvemailforward' >/root/.forward
if ! test -f /root/.forward || ! grep -q '|/usr/bin/pvemailforward' /root/.forward; then
echo '|/usr/bin/pvemailforward' >>/root/.forward
fi
if [ -f /etc/systemd/system/ceph.service ]; then