VNSTAT: configfile overwritten after reboot [SOLVED]

Started by sdetroch, June 21, 2024, 02:15:23 PM

Previous topic - Next topic
June 21, 2024, 02:15:23 PM Last Edit: June 21, 2024, 09:58:23 PM by sdetroch
Hello,

the vnstat configfile located in /usr/local/etc/vnstat.conf is overwritten after every reboot (or restart of the service). Since the plugin in OpnSense is not using our default date notation (YY-MM-DD and not DD-MM-YY) etc ... I have modified the config file, but how can I keep the modified config after reboot? Changing the .sample file as well didn't help.

If not possible, maybe make the parameters available in the OpnSense GUI?

Will try to solve it by copying the saved config over the default config after boot (not tested yet), created the following file. I will not expect issues?

/usr/local/etc/rc.syshook.d/start/93-vnstat


#!/bin/sh

echo -n "Restoring vnstat config"
cp /usr/local/etc/vnstat.conf.restore /usr/local/etc/vnstat.conf


June 21, 2024, 07:02:40 PM #3 Last Edit: June 21, 2024, 09:58:11 PM by sdetroch
Thanks a lot, that's indeed easier.
Wasn't aware of this template.