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

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Mar 6 12:10:48 CET 2018


On Wed, Jan 24, 2018 at 02:12:33PM +0100, Thomas Lamprecht wrote:
> 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

this actually changes the behaviour, as an existing .forward which does
not contain pvemailforward is overwritten instead of extended.

if this change is intentional, it should be mentioned in the commit
message ;)

>  	echo '|/usr/bin/pvemailforward' >/root/.forward
>      fi
>  
> -- 
> 2.14.2
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list