fix: sudogen: proper detection of OS-specific templates

This commit is contained in:
Stéphane Lesimple 2020-12-03 09:34:32 +00:00
parent a4317c8c31
commit 526a5d0389
No known key found for this signature in database
GPG key ID: 4B4A3289E9D35658

View file

@ -46,8 +46,8 @@ generate_account_sudoers()
do
# if $template has two dots, then it's of the form XXX-name.$os.sudoers,
# in that case we only include this template if $os is our current OS
if [ "$(echo "$template" | cut -d. -f3)" = "sudoers" ]; then
if [ "$(echo "$template" | cut -d. -f2 | tr '[:upper:]' '[:lower:]')" != "$(echo "$OS_FAMILY" | tr '[:upper:]' '[:lower:]')" ]; then
if [ "$(basename "$template" | cut -d. -f3)" = "sudoers" ]; then
if [ "$(basename "$template" | cut -d. -f2 | tr '[:upper:]' '[:lower:]')" != "$(echo "$OS_FAMILY" | tr '[:upper:]' '[:lower:]')" ]; then
# not the same OS, skip it
continue
fi