diff --git a/recipes-support/vnstat/vnstat_2.6.bb b/recipes-support/vnstat/vnstat_2.6.bb index 9a650f4..03e1dba 100644 --- a/recipes-support/vnstat/vnstat_2.6.bb +++ b/recipes-support/vnstat/vnstat_2.6.bb @@ -13,6 +13,18 @@ inherit autotools pkgconfig systemd EXTRA_OECONF = "--disable-extra-paths" +do_configure_append() { + # enable a volatile and persistent path for reading and writing the data base: + sed -i 's|ReadWritePaths=\/var\/lib|ReadWritePaths=\/var\/lib \/run\/|g' ${S}/examples/systemd/vnstat.service + + # adapt the default config running in volatile mode + sed -i 's|DatabaseDir \"\/var\/lib\/vnstat\"|DatabaseDir \"\/run\/vnstat\"|g' ${S}/cfg/vnstat.conf + + # add wwan0 as default interface + sed -i 's|Interface \"\"|Interface \"wwan0\"|g' ${S}/cfg/vnstat.conf +} + + do_install_append() { install -Dm644 ${S}/examples/systemd/vnstat.service "${D}${systemd_system_unitdir}/vnstat.service" }