mirror of
https://github.com/ovh/the-bastion.git
synced 2025-09-30 08:44:21 +08:00
fix: sudogen: proper detection of OS-specific templates
This commit is contained in:
parent
a4317c8c31
commit
526a5d0389
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue