Skip to content

Instantly share code, notes, and snippets.

@hannesbe
Last active March 10, 2018 01:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannesbe/f23c1f339904bc0ee484455a9ca6d978 to your computer and use it in GitHub Desktop.
Save hannesbe/f23c1f339904bc0ee484455a9ca6d978 to your computer and use it in GitHub Desktop.
Update Netbox
#!/bin/bash
#
# Update script for Nextbox on CentOS 7
# Releases on https://github.com/digitalocean/netbox/releases
#
# Example usage:
# NETBOX_RELEASE=2.2.6 ./update-netbox.sh
cd /opt
wget https://github.com/digitalocean/netbox/archive/v$NETBOX_RELEASE.tar.gz
tar -xzf v$NETBOX_RELEASE.tar.gz -C /opt
cp netbox/netbox/netbox/configuration.py netbox-$NETBOX_RELEASE/netbox/netbox/configuration.py
cp netbox/gunicorn_config.py netbox-$NETBOX_RELEASE/gunicorn_config.py
cd netbox-$NETBOX_RELEASE
./upgrade.sh
rm -f /opt/netbox
ln -sf /opt/netbox-$NETBOX_RELEASE /opt/netbox
supervisorctl restart netbox
systemctl restart supervisord.service
systemctl restart nginx.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment