From c84f219089cbc4f63932d959f517fc07fcfed9b4 Mon Sep 17 00:00:00 2001 From: Baris Can Daylik Date: Mon, 25 Mar 2024 12:51:43 +0300 Subject: [PATCH] update vnstat_backup service to use default DatabaseDir if not specified --- openmptcprouter/files/etc/init.d/vnstat_backup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmptcprouter/files/etc/init.d/vnstat_backup b/openmptcprouter/files/etc/init.d/vnstat_backup index 02e9be3147..37e2b4ebfb 100755 --- a/openmptcprouter/files/etc/init.d/vnstat_backup +++ b/openmptcprouter/files/etc/init.d/vnstat_backup @@ -10,12 +10,13 @@ START=98 STOP=10 vnstat_option() { - sed -ne "s/^[;]*$1[[:space:]]*['\"]\([^'\"]*\)['\"].*/\1/p" /etc/vnstat.conf + sed -ne "s/^[[:space:]]*$1[[:space:]]*['\"]\([^'\"]*\)['\"].*/\1/p" /etc/vnstat.conf } BACKUP_FILE=/etc/vnstat_backup.tar.gz LOGGER_TAG=vnstat_backup VNSTAT_DIR="$(vnstat_option DatabaseDir)" +[ -n "$VNSTAT_DIR" ] || VNSTAT_DIR="/var/lib/vnstat" _chk_omrquota() { config_get enabled $1 enabled