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 #!/usr/bin/env bash
# Set config-file permissions # Only execute on first install
chown -R chirpstack:chirpstack /etc/chirpstack if [[ -z $2 ]]; then
chmod 750 /etc/chirpstack # Set config-file permissions
chmod 640 /etc/chirpstack/*.toml chown -R chirpstack:chirpstack /etc/chirpstack
chmod 750 /etc/chirpstack
chmod 640 /etc/chirpstack/*.toml
# Set environment variables to localhost # Set environment variables to localhost
sed -i "s/\$MQTT_BROKER_HOST/localhost/" /etc/chirpstack/*.toml sed -i "s/\$MQTT_BROKER_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$POSTGRESQL_HOST/localhost/" /etc/chirpstack/*.toml sed -i "s/\$POSTGRESQL_HOST/localhost/" /etc/chirpstack/*.toml
sed -i "s/\$REDIS_HOST/localhost/" /etc/chirpstack/*.toml sed -i "s/\$REDIS_HOST/localhost/" /etc/chirpstack/*.toml
fi
#DEBHELPER# #DEBHELPER#