From 1495cab2e44c4a2af0446ac6b20002cf880301d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=D0=B8=D0=B9?= Date: Sun, 20 Jun 2021 16:55:21 +0300 Subject: [PATCH] Fix --- front_pwquality.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/front_pwquality.sh b/front_pwquality.sh index d3b5a41..0209ba2 100644 --- a/front_pwquality.sh +++ b/front_pwquality.sh @@ -20,7 +20,11 @@ PWQUALITY_FRONT=1 if ! [[ -f "${VAR_DIR_PWQUALITY}/pw_changed" ]]; then cat "$PW_DEFAULT" > "${DESTDIR}/etc/security/pwquality.conf" || { error $"Unable to write to file %s" "${DESTDIR}/etc/security/pwquality.conf"; exit 1; } install -D -m 444 /dev/null "${VAR_DIR_PWQUALITY}/pw_changed" || { error $"Unable to write to file %s" "${VAR_DIR_PWQUALITY}/pw_changed"; exit 1; } -fi +fi +if [[ "$(grep "^#" "${DESTDIR}/etc/security/pwquality.conf")" ]]; then + cat "$PW_DEFAULT" > "${DESTDIR}/etc/security/pwquality.conf" || { error $"Unable to write to file %s" "${DESTDIR}/etc/security/pwquality.conf"; exit 1; } + install -D -m 444 /dev/null "${VAR_DIR_PWQUALITY}/pw_changed" || { error $"Unable to write to file %s" "${VAR_DIR_PWQUALITY}/pw_changed"; exit 1; } +fi # In case the config was changed manually, or there were errors in it, # we check whether everything can be parsed correctly, and if not, it outputs an error