__netbox: fix shellcheck by changing parameter checks
The working `ls | grep .` like solution was dropped based on the shellcheck warning. Rather a solution with `find(1)` is used. As alternative, it could be simply checked if the glob succeeds or not by test all given arguments if there are existing files. It was dropped in question if it's really better than the `find(1)` solution.
This commit is contained in:
parent
0281b2c804
commit
a05cb214e1
1 changed files with 1 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# no configuration if there are no ldap parameters
|
||||
if ls -1qA "$__object/parameter"/ldap-* | grep -q .; then
|
||||
if [ "$(find "$__object/parameter/" -type f -name 'ldap-*' -print)" ]; then
|
||||
# skip
|
||||
cat << EOF
|
||||
##############################
|
||||
|
|
Loading…
Reference in a new issue