From 5ee4a42a81d995faae3f5e8cc80b48f27a348c90 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Fri, 15 May 2020 10:58:14 -0700 Subject: [PATCH] hardcoded database name --- Makefile | 2 +- QnetGateway.cpp | 6 ++---- QnetGateway.h | 2 +- QnetLink.cpp | 7 ++----- QnetLink.h | 2 +- defaults | 1 - qnconfig | 8 +------- 7 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 194716a..4fb7c72 100644 --- a/Makefile +++ b/Makefile @@ -195,7 +195,7 @@ uninstallbase : /bin/rm -f $(SYSDIR)/qnlink.service /bin/rm -f $(BINDIR)/qnlink /bin/rm -f $(CFGDIR)/*.dat - /bin/rm -f $(CFGDIR)/RPT_STATUS.txt + /bin/rm -f $(CFGDIR)/qn.db /bin/rm -f $(CFGDIR)/gwys.txt /bin/rm -f $(BINDIR)/exec_?.sh diff --git a/QnetGateway.cpp b/QnetGateway.cpp index d8325ce..5db675e 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -54,7 +54,7 @@ #define CFG_DIR "/usr/local/etc" #endif -const std::string GW_VERSION("QnetGateway-511"); +const std::string GW_VERSION("QnetGateway-515"); static std::atomic keep_running(true); @@ -325,7 +325,6 @@ bool CQnetGateway::ReadConfig(char *cfgFile) path.assign("dash_"); cfg.GetValue(path+"show_order", estr, DASH_SHOW_ORDER, 2, 17); showLastHeard = (std::string::npos != DASH_SHOW_ORDER.find("LH")); - cfg.GetValue(path+"sql_filename", estr, DASH_SQL_NAME, 1, 32); return false; } @@ -2313,8 +2312,7 @@ bool CQnetGateway::Init(char *cfgfile) // open database std::string fname(CFG_DIR); - fname.append("/"); - fname.append(DASH_SQL_NAME); + fname.append("/qn.db"); if (qnDB.Open(fname.c_str())) return true; qnDB.ClearLH(); diff --git a/QnetGateway.h b/QnetGateway.h index a7308ec..17e4036 100644 --- a/QnetGateway.h +++ b/QnetGateway.h @@ -102,7 +102,7 @@ private: std::string gate2link, link2gate, gate2modem[3], modem2gate; - std::string OWNER, owner, FILE_DTMF, FILE_ECHOTEST, IRCDDB_PASSWORD[2], FILE_QNVOICE_FILE, DASH_SQL_NAME, DASH_SHOW_ORDER; + std::string OWNER, owner, FILE_DTMF, FILE_ECHOTEST, IRCDDB_PASSWORD[2], FILE_QNVOICE_FILE, DASH_SHOW_ORDER; bool GATEWAY_SEND_QRGS_MAP, GATEWAY_HEADER_REGEN, APRS_ENABLE, playNotInCache, showLastHeard; bool LOG_DEBUG, LOG_IRC, LOG_DTMF, LOG_QSO, IS_HF[3]; diff --git a/QnetLink.cpp b/QnetLink.cpp index 1b68285..9dcf5ce 100644 --- a/QnetLink.cpp +++ b/QnetLink.cpp @@ -54,7 +54,7 @@ #include "QnetLink.h" #include "Utilities.h" -#define LINK_VERSION "QnetLink-511" +#define LINK_VERSION "QnetLink-515" #ifndef BIN_DIR #define BIN_DIR "/usr/local/bin" #endif @@ -539,8 +539,6 @@ bool CQnetLink::ReadConfig(const char *cfgFile) } cfg.GetValue(key+"priority", estr, dplus_priority); - cfg.GetValue("dash_sql_filename", estr, dash_sql_name, 2, 32); - return false; } @@ -3288,8 +3286,7 @@ bool CQnetLink::Init(const char *cfgfile) } // open sqlite std::string fname(CFG_DIR); - fname.append("/"); - fname.append(dash_sql_name); + fname.append("/qn.db"); if (qnDB.Open(fname.c_str())) return true; qnDB.ClearLS(); diff --git a/QnetLink.h b/QnetLink.h index 2332ab7..d278941 100644 --- a/QnetLink.h +++ b/QnetLink.h @@ -101,7 +101,7 @@ private: void RptrAckThread(char *arg); /* configuration data */ - std::string login_call, owner, to_g2_external_ip, my_g2_link_ip, gwys, dash_sql_name, qnvoice_file, announce_dir; + std::string login_call, owner, to_g2_external_ip, my_g2_link_ip, gwys, qnvoice_file, announce_dir; bool only_admin_login, only_link_unlink, qso_details, log_debug, bool_rptr_ack, announce; bool dplus_authorize, dplus_reflectors, dplus_repeaters, dplus_priority; unsigned short rmt_xrf_port, rmt_ref_port, rmt_dcs_port, my_g2_link_port, to_g2_external_port; diff --git a/defaults b/defaults index 7e0baf9..96f0948 100644 --- a/defaults +++ b/defaults @@ -216,7 +216,6 @@ timing_play_delay_d=19 # milliseconds between frames playback, if echo so # # Dashboard - for the php/sqlite webpage # -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_order_d='MO,LH,SY,UR' # Show sections in this order, (not in default: IP and PS) diff --git a/qnconfig b/qnconfig index 8ccb54d..de027d4 100755 --- a/qnconfig +++ b/qnconfig @@ -141,9 +141,6 @@ DashboardMenu () { echo echo " Dashboard Menu" echo - if [ -n "$em" ]; then - echo -n "n : Name of the database file = "; EvaluateVar dash_sql_filename{,_d} - fi echo -n "r : Refresh time (sec) for page = "; EvaluateVar dash_refresh{,_d} echo -n "c : Max number of last heard entries = "; EvaluateVar dash_lastheard_count{,_d} echo -n "o : Show Section Order = "; EvaluateVar dash_show_order{,_d} @@ -160,13 +157,11 @@ DashboardMenu () { echo " UR is the Send URCall Section" EndMenu - if [[ "$key" == n* ]]; then dash_sql_filename="$value" elif [[ "$key" == r* ]]; then dash_refresh="$value" elif [[ "$key" == c* ]]; then dash_lastheard_count="$value" elif [[ "$key" == o* ]]; then dash_show_order="${value^^}" elif [[ "$key" == u* ]]; then - if [[ "$value" == n* ]]; then unset dash_sql_filename - elif [[ "$value" == r* ]]; then unset dash_refresh + if [[ "$value" == r* ]]; then unset dash_refresh elif [[ "$value" == c* ]]; then unset dash_lastheard_count elif [[ "$value" == o* ]]; then unset dash_show_order fi @@ -696,7 +691,6 @@ WriteCFGFile () { [ -z "${timing_play_wait+x}" ] || echo "timing_play_wait=${timing_play_wait}" >> $outFile [ -z "${timing_play_delay+x}" ] || echo "timing_play_delay=${timing_play_delay}" >> $outFile # dash_ section - [ -z "${dash_sql_filename+x}" ] || echo "dash_sql_filename='${dash_sql_filename}'" >> $outFile [ -z "${dash_refresh+x}" ] || echo "dash_refresh=${dash_refresh}" >> $outFile [ -z "${dash_lastheard_count+x}" ] || echo "dash_lastheard_count=${dash_lastheard_count}" >> $outFile [ -z "${dash_show_order+x}" ] || echo "dash_show_order='${dash_show_order}'" >> $outFile