__netbox_uwsgi: fix shellcheck

Fixed shellcheck cause of the find command. This required a bigger
change due to variables and subshell. Now, input is used through a
here-document.
This commit is contained in:
matze 2020-09-05 19:09:34 +02:00
parent 755bd9098e
commit 5a403de057
2 changed files with 7 additions and 6 deletions
type/__netbox_uwsgi

View file

@ -29,10 +29,14 @@ cat << EOF
EOF EOF
# special protocol to bind # special protocol to bind
for param in $(find "$__object/parameter/" -maxdepth 1 -name "*-bind" -print); do while read -r param; do
multi_options "$(basename "$param" | awk -F'-' '{print $1}')-socket" "$param" multi_options "$(basename "$param" | awk -F'-' '{print $1}')-socket" "$param"
socket_changes=yes socket_changes="yes"
done
done << INPUT # here-doc cause of SC2031
$( find "$__object/parameter/" -maxdepth 1 -name "*-bind" -print )
INPUT
# else, default bind to # else, default bind to
if [ -z "$socket_changes" ]; then if [ -z "$socket_changes" ]; then
multi_options "socket" "$__object/parameter/bind-to" multi_options "socket" "$__object/parameter/bind-to"

View file

@ -1,8 +1,5 @@
#!/bin/sh -e #!/bin/sh -e
HOST="$__object/parameter/bind-to"
export HOST
# process template # process template
mkdir "$__object/files" mkdir "$__object/files"
"$__type/files/uwsgi.ini.sh" > "$__object/files/uwsgi.ini" "$__type/files/uwsgi.ini.sh" > "$__object/files/uwsgi.ini"