2020-08-26 18:01:23 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
curr_installed="$(cat "$__object/explorer/installed")"
|
|
|
|
should_installed="$(cat "$__object/explorer/should_installed")"
|
|
|
|
|
|
|
|
# gunicorn version change
|
|
|
|
if [ "$curr_installed" != "$should_installed" ]; then
|
|
|
|
# (re)installing gunicorn
|
|
|
|
echo "/opt/netbox/venv/bin/pip3 install 'gunicorn==$should_installed'"
|
|
|
|
|
|
|
|
do_restart=yes
|
|
|
|
printf "updated %s to %s\n" "$curr_installed" "$should_installed" \
|
|
|
|
>> "$__messages_out"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# configuration changes
|
|
|
|
if grep -q "^__file/opt/netbox/gunicorn.py:" "$__messages_in"; then
|
|
|
|
do_restart=yes
|
2020-08-27 17:46:09 +00:00
|
|
|
printf "configured\n" >> "$__messages_out"
|
2020-08-26 18:01:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# restart gunicorn
|
2020-08-27 17:46:09 +00:00
|
|
|
if [ "$do_restart" ]; then
|
2020-08-26 18:01:23 +00:00
|
|
|
cat << EOF
|
|
|
|
# Restart service
|
|
|
|
service gunicorn-netbox restart
|
|
|
|
EOF
|
|
|
|
fi
|