2020-08-26 18:01:23 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
HOST=""
|
|
|
|
while read -r host; do
|
2020-09-01 10:40:05 +00:00
|
|
|
# shellcheck disable=SC2089
|
2020-08-26 18:01:23 +00:00
|
|
|
HOST="$HOST '$host',"
|
|
|
|
done < "$__object/parameter/bind-to"
|
2020-09-01 10:40:05 +00:00
|
|
|
export HOST # shellcheck disable=SC2090
|
2020-08-26 18:01:23 +00:00
|
|
|
|
|
|
|
# process template
|
|
|
|
mkdir "$__object/files"
|
|
|
|
"$__type/files/gunicorn.py.sh" > "$__object/files/gunicorn.py"
|
|
|
|
|
|
|
|
# gunicorn config file
|
|
|
|
__file /opt/netbox/gunicorn.py \
|
|
|
|
--mode 644 --source "$__object/files/gunicorn.py"
|
|
|
|
|
|
|
|
# install service file
|
|
|
|
__systemd_unit gunicorn-netbox.service \
|
|
|
|
--source "$__type/files/netbox.service" \
|
|
|
|
--enablement-state enabled --restart
|