#!/bin/sh # Installs gladios, or upgrades it in place. # # curl -fsSL https://gladios.dev/install.sh | sudo sh this host, the latest release # sudo ./install.sh this host, from this checkout # ./install.sh path/to/tree files only, into a tree that mirrors a host's / # # On this host it also gets nginx's njs module loaded (installing its package if needed) and writes # /etc/gladios/secret.conf and /etc/gladios/settings.conf unless they exist. It never overwrites # anything in /etc/gladios and never reloads nginx. If `nginx -t` fails with the new files, it puts # the old ones back. # # POSIX sh, for hosts without bash. Defined as functions and run on the last line, so a download # cut short runs nothing. set -eu # what's downloaded when this script isn't beside a checkout (gladios.dev builds it from main) GLADIOS_URL=${GLADIOS_URL:-https://gladios.dev/gladios.tar.gz} fail() { echo "gladios: $*" >&2 exit 1 } # nginx -V's value for --