Only update logindefs when needed
This commit is contained in:
parent
51de0ff9b3
commit
c80feb6768
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue