From c80feb676894200aedba4db4b85d18d456f02e30 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 7 Aug 2017 17:31:37 +0100 Subject: [PATCH] Only update logindefs when needed --- src/freedombone-utils-setup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-setup b/src/freedombone-utils-setup index cc3a1893..b7ad2e96 100755 --- a/src/freedombone-utils-setup +++ b/src/freedombone-utils-setup @@ -455,7 +455,8 @@ function remove_management_engine_interface { } function set_login_umask { - if ! grep -q 'UMASK\t\t077' /etc/login.defs; then + logindefs_umask=$(cat /etc/login.defs | grep UMASK | grep -v '#') + if [[ "$logindefs_umask" != *'077' ]]; then sed -i 's|UMASK\t.*|UMASK\t\t077|g' /etc/login.defs fi }