Files
firezone/rust/gateway/debian/postinst
Thomas Eizinger f98c4dd428 fix(gateway): declare hard-dependency on systemd (#10803)
Several aspects of the Gateway's Debian package depend on `systemd`
being present. Without it, we don't have the necessary users and files
in place for the Gateway to function. With that specified, we can fail
the `postinst` script (and therefore the installation) if anything in
there goes wrong.
2025-11-07 14:33:30 +00:00

16 lines
623 B
Bash

#!/usr/bin/env bash
set -e
systemd-sysusers firezone-gateway.conf
#DEBHELPER#
# Generate a deterministic ID based of `/etc/machine-id`
FIREZONE_ID=$(systemd-id128 --app-specific=753b38f9f96947ef8083802d5909a372 machine-id)
# We fully overwrite the `gateway-present-env` file on every run.
# Maintainer scripts need to be deterministic and that seems to be the easiest way.
printf "# This file is managed by maintainer scripts. Do not touch!\n# Use \`etc/firezone/gateway-env\` for custom configuration.\n" >/etc/firezone/gateway-preset-env
printf "FIREZONE_ID=%s\n" "${FIREZONE_ID}" >>/etc/firezone/gateway-preset-env