Keep pre-rebrand dedicated installs compatible

This commit is contained in:
Alexander Sellite 2026-08-25 22:18:56 -04:00
parent c1b228475d
commit cd423d0c70
4 changed files with 59 additions and 10 deletions

View file

@ -10,12 +10,29 @@ if [[ ${EUID} -ne 0 ]]; then
exit 2
fi
install_root="${straywild_INSTALL_ROOT:-/opt/straywild-server}"
service_name="${straywild_SERVICE_NAME:-straywild-server.service}"
if [[ -n "${straywild_INSTALL_ROOT:-}" ]]; then
install_root="${straywild_INSTALL_ROOT}"
elif [[ -n "${NETFISHING_INSTALL_ROOT:-}" ]]; then
install_root="${NETFISHING_INSTALL_ROOT}"
elif [[ -d /opt/netfishing-server ]]; then
install_root="/opt/netfishing-server"
else
install_root="/opt/straywild-server"
fi
if [[ -n "${straywild_SERVICE_NAME:-}" ]]; then
service_name="${straywild_SERVICE_NAME}"
elif [[ -n "${NETFISHING_SERVICE_NAME:-}" ]]; then
service_name="${NETFISHING_SERVICE_NAME}"
elif command -v systemctl >/dev/null \
&& systemctl cat netfishing-server.service >/dev/null 2>&1; then
service_name="netfishing-server.service"
else
service_name="straywild-server.service"
fi
releases_dir="${install_root}/releases"
if [[ "${install_root}" != /* || "${install_root}" == "/" ]]; then
echo "straywild_INSTALL_ROOT must be a specific absolute directory." >&2
echo "The install root must be a specific absolute directory." >&2
exit 2
fi
if [[ ! -L "${install_root}/current" || ! -L "${install_root}/previous" ]]; then