Fix postinst to only run on install.

Fixes #295.
This commit is contained in:
Orne Brocaar 2023-10-11 09:37:20 +01:00
parent 4506cd91eb
commit 89a44dcf6b

View File

@ -1,13 +1,16 @@
#!/usr/bin/env bash
# Set config-file permissions
chown -R chirpstack:chirpstack /etc/chirpstack
chmod 750 /etc/chirpstack
chmod 640 /etc/chirpstack/*.toml
# Only execute on first install
if [[ -z $2 ]]; then
# Set config-file permissions
chown -R chirpstack:chirpstack /etc/chirpstack
chmod 750 /etc/chirpstack
chmod 640 /etc/chirpstack/*.toml
# Set environment variables to localhost
sed -i "s/\$MQTT_BROKER_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$POSTGRESQL_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$REDIS_HOST/localhost/" /etc/chirpstack/*.toml
# Set environment variables to localhost
sed -i "s/\$MQTT_BROKER_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$POSTGRESQL_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$REDIS_HOST/localhost/" /etc/chirpstack/*.toml
fi
#DEBHELPER#