diff --git a/Makefile b/Makefile index a8edf33..4252bb4 100644 --- a/Makefile +++ b/Makefile @@ -261,3 +261,4 @@ uninstalldash : /bin/rm -f $(SYSDIR)/qndash.service systemctl daemon-reload /bin/rm -f $(WWWDIR)/index.php + /bin/rm -f $(CFGDIR)/qn.db diff --git a/QnetGateway.cpp b/QnetGateway.cpp index d336fb6..a5be4d6 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -50,6 +50,10 @@ #include "QnetGateway.h" #include "Utilities.h" +#ifndef CFG_DIR +#define CFG_DIR "/usr/local/etc" +#endif + const std::string GW_VERSION("QnetGateway-9.3"); extern void dstar_dv_init(); @@ -351,7 +355,7 @@ bool CQnetGateway::ReadConfig(char *cfgFile) // dashboard path.assign("dash_"); - cfg.GetValue(path+"enable_lastheard", estr, DASH_SHOW_LH); + cfg.GetValue(path+"show_lh", estr, DASH_SHOW_LH); cfg.GetValue(path+"sql_filename", estr, DASH_SQL_NAME, 1, 32); return false; @@ -2461,8 +2465,13 @@ bool CQnetGateway::Init(char *cfgfile) } // open database - if (DASH_SHOW_LH && qnDB.Open(DASH_SQL_NAME.c_str())) - return true; + if (DASH_SHOW_LH) { + std::string dbname(CFG_DIR); + dbname.append("/"); + dbname.append(DASH_SQL_NAME); + if (qnDB.Open(dbname.c_str())) + return true; + } playNotInCache = false; diff --git a/defaults b/defaults index b211686..c48d371 100644 --- a/defaults +++ b/defaults @@ -216,11 +216,11 @@ timing_play_delay_d=19 # milliseconds between frames playback, if echo so # # Dashboard - for the php/sqlite webpage # -dash_sql_filename_d='/usr/local/etc/qn.db' # name for the sqlite database -dash_refresh_d=20 # seconds for the webpage to reload -dash_lastheard_count_d=20 # maximum number of last heard entries to display -dash_show_lh_d=true # set to false if for no Last Heard section -dash_show_ps_d=true # set to false if for no Processes section -dash_show_ip_d=true # set to false if for no IP Addresses section -dash_show_mo_d=true # set to false if for no Modules section -dash_show_ur_d=true # set to false if for Send URCall section +dash_sql_filename_d='qn.db' # name for the sqlite database in the $CFGDIR directory +dash_refresh_d=20 # seconds for the webpage to reload +dash_lastheard_count_d=20 # maximum number of last heard entries to display +dash_show_lh_d=true # set to false if for no Last Heard section +dash_show_ps_d=true # set to false if for no Processes section +dash_show_ip_d=true # set to false if for no IP Addresses section +dash_show_mo_d=true # set to false if for no Modules section +dash_show_ur_d=true # set to false if for Send URCall section