mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fix vnstat backup
This commit is contained in:
parent
4cd0d46a12
commit
d7c85c8cce
3 changed files with 3 additions and 3 deletions
|
@ -749,7 +749,7 @@ function settings_add()
|
|||
|
||||
-- Enable/disable vnstat backup
|
||||
local savevnstat = luci.http.formvalue("savevnstat") or "0"
|
||||
luci.sys.exec("uci -q set vnstat.@vnstat[0].backup=%s" % savevnstat)
|
||||
luci.sys.exec("uci -q set openmptcprouter.settings.vnstat_backup=%s" % savevnstat)
|
||||
ucic:commit("vnstat")
|
||||
|
||||
-- Enable/disable gateway ping
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Save vnstats stats%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="savevnstat" class="cbi-input-checkbox" value="1" <% if luci.util.trim(luci.sys.exec("uci -q get vnstat.@vnstat[0].backup")) == "1" then %>checked<% end %>>
|
||||
<input type="checkbox" name="savevnstat" class="cbi-input-checkbox" value="1" <% if luci.util.trim(luci.sys.exec("uci -q get openmptcprouter.settings.vnstat_backup")) == "1" then %>checked<% end %>>
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Save vnstats statistics on disk%>
|
||||
|
|
|
@ -26,7 +26,7 @@ backup_database() {
|
|||
backup="false"
|
||||
config_load omr-quota
|
||||
config_foreach _chk_omrquota interface
|
||||
[ "$(uci -q get vnstat.@vnstat[0].backup)" = "1" ] && backup="true"
|
||||
[ "$(uci -q get openmptcprouter.settings.vnstat_backup)" = "1" ] && backup="true"
|
||||
if [ "$backup" = "true" ]; then
|
||||
if [ ! -d $VNSTAT_DIR ]; then
|
||||
logger -t $LOGGER_TAG -p err "cannot backup, data directory $VNSTAT_DIR does not exist (yet)"
|
||||
|
|
Loading…
Reference in a new issue