Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
VNSTAT: configfile overwritten after reboot [SOLVED]
« previous
next »
Print
Pages: [
1
]
Author
Topic: VNSTAT: configfile overwritten after reboot [SOLVED] (Read 460 times)
sdetroch
Newbie
Posts: 14
Karma: 1
VNSTAT: configfile overwritten after reboot [SOLVED]
«
on:
June 21, 2024, 02:15:23 pm »
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?
«
Last Edit: June 21, 2024, 09:58:23 pm by sdetroch
»
Logged
sdetroch
Newbie
Posts: 14
Karma: 1
Re: VNSTAT: configfile overwritten after reboot
«
Reply #1 on:
June 21, 2024, 05:15:24 pm »
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
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1602
Karma: 176
Re: VNSTAT: configfile overwritten after reboot
«
Reply #2 on:
June 21, 2024, 06:05:44 pm »
You could change the template.
https://github.com/opnsense/plugins/blob/master/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat.conf
Logged
Hardware:
DEC740
sdetroch
Newbie
Posts: 14
Karma: 1
Re: VNSTAT: configfile overwritten after reboot
«
Reply #3 on:
June 21, 2024, 07:02:40 pm »
Thanks a lot, that's indeed easier.
Wasn't aware of this template.
«
Last Edit: June 21, 2024, 09:58:11 pm by sdetroch
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
VNSTAT: configfile overwritten after reboot [SOLVED]