Files
firezone/scripts/firezone-client-gui-install.sh
Reactor Scram d59c3fef0a build(gui-client): add post-install and pre-remove scripts to the deb package (#5011)
Closes #4987

```[tasklist]
### Before merging
- [x] Get an x64 test VM on the Windows laptop and test a CI-built deb
```
2024-05-16 23:03:21 +00:00

26 lines
880 B
Bash
Executable File

#!/usr/bin/env bash
# Usage: ./firezone-client-gui-install.sh ./firezone-client-gui_VERSION_ARCH.deb
#
# The `./` is necessary
#
# This script should be idempotent, so it can be used for upgrades, too.
set -euox pipefail
# `apt-get` needs either a leading `./` or `/` to recognize a local file path
DEB_PATH=$(realpath "$1")
GROUP_NAME="firezone-client"
echo "Installing Firezone..."
sudo apt-get install --yes "$DEB_PATH"
echo "Adding your user to the $GROUP_NAME group..."
sudo usermod -a -G "$GROUP_NAME" "$USER"
# Check if the user is already in the group
if ! groups | grep "$GROUP_NAME" &>/dev/null; then
# Unfortunately Ubuntu seems to need a reboot here, at least 20.04 does
echo "You MUST reboot to finish adding yourself to the group. Firezone won't function correctly until this is done."
else
echo "Finished installing / upgrading Firezone Client."
fi