mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
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.
16 lines
623 B
Bash
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
|