From b2e35d79088207017a73ac30e84b57d69852742a Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 21 Feb 2023 09:34:11 -0700 Subject: [PATCH] rename to ReflStateFile --- .gitignore | 3 --- reflector/Configure.cpp | 8 ++++---- reflector/JsonKeys.h | 4 ++-- reflector/Makefile | 18 +++++------------- reflector/example.ini | 2 +- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 6e6d5ab..fcb78c0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,6 @@ reflector/urfd.whitelist reflector/urfd.interlink reflector/urfd.terminal configure.mk -configure.h -configure.sql -reflector.cfg wiresx/configure.php urfd* inicheck diff --git a/reflector/Configure.cpp b/reflector/Configure.cpp index c6546c5..886dce4 100644 --- a/reflector/Configure.cpp +++ b/reflector/Configure.cpp @@ -55,7 +55,6 @@ #define JIPV4EXTERNAL "IPv4External" #define JIPV6BINDING "IPv6Binding" #define JIPV6EXTERNAL "IPv6External" -#define JJSONPATH "JsonPath" #define JM17 "M17" #define JMMDVM "MMDVM" #define JMODE "Mode" @@ -72,6 +71,7 @@ #define JREGISTRATIONID "RegistrationID" #define JREGISTRATIONNAME "RegistrationName" #define JSPONSOR "Sponsor" +#define JREFLSTATEPATH "ReflStatePath" #define JSYSOPEMAIL "SysopEmail" #define JTRANSCODED "Transcoded" #define JTRANSCODER "Transcoder" @@ -456,8 +456,8 @@ bool CConfigure::ReadData(const std::string &path) case ESection::files: if (0 == key.compare(JPIDPATH)) data[g_Keys.files.pid] = value; - else if (0 == key.compare(JJSONPATH)) - data[g_Keys.files.json] = value; + else if (0 == key.compare(JREFLSTATEPATH)) + data[g_Keys.files.state] = value; else if (0 == key.compare(JWHITELISTPATH)) data[g_Keys.files.white] = value; else if (0 == key.compare(JBLACKLISTPATH)) @@ -672,7 +672,7 @@ bool CConfigure::ReadData(const std::string &path) } // Other files isDefined(ErrorLevel::fatal, JFILES, JPIDPATH, g_Keys.files.pid, rval); - isDefined(ErrorLevel::fatal, JFILES, JJSONPATH, g_Keys.files.json, rval); + isDefined(ErrorLevel::fatal, JFILES, JREFLSTATEPATH, g_Keys.files.state, rval); isDefined(ErrorLevel::fatal, JFILES, JWHITELISTPATH, g_Keys.files.white, rval); isDefined(ErrorLevel::fatal, JFILES, JBLACKLISTPATH, g_Keys.files.black, rval); isDefined(ErrorLevel::fatal, JFILES, JINTERLINKPATH, g_Keys.files.interlink, rval); diff --git a/reflector/JsonKeys.h b/reflector/JsonKeys.h index 83a2b03..38b06b6 100644 --- a/reflector/JsonKeys.h +++ b/reflector/JsonKeys.h @@ -52,6 +52,6 @@ struct SJsonKeys { dmriddb { "dmrIdDbUrl", "dmrIdDbMode", "dmrIdDbRefresh", "dmrIdDbFilePath" }, nxdniddb { "nxdnIdDbUrl", "nxdnIdDbMode", "nxdnIdDbRefresh", "nxdnIdDbFilePath" }, ysftxrxdb { "ysfIdDbUrl", "ysfIdDbMode", "ysfIdDbRefresh", "ysfIdDbFilePath" }; - struct FILES { const std::string pid, json, white, black, interlink, terminal; } - files { "pidFilePath", "jsonFilePath", "whitelistFilePath", "blacklistFilePath", "interlinkFilePath", "g3TerminalFilePath" }; + struct FILES { const std::string pid, state, white, black, interlink, terminal; } + files { "pidFilePath", "stateFilePath", "whitelistFilePath", "blacklistFilePath", "interlinkFilePath", "g3TerminalFilePath" }; }; diff --git a/reflector/Makefile b/reflector/Makefile index 292bf49..ef6b2b6 100644 --- a/reflector/Makefile +++ b/reflector/Makefile @@ -48,7 +48,7 @@ $(INICHECK) : Configure.cpp CurlGet.o $(CXX) -DINICHECK $(CFLAGS) $< CurlGet.o -o $@ -lcurl $(DBUTIL) : Main.cpp $(DBUTILOBJS) - $(CXX) -DUTILITY $(CFLAGS) $< $(DBUTILOBJS) -o $@ -lcurl + $(CXX) -DUTILITY $(CFLAGS) $< $(DBUTILOBJS) -o $@ -pthread -lcurl %.o : %.cpp $(CXX) $(CFLAGS) -c $< -o $@ @@ -59,23 +59,15 @@ clean : -include $(DEPS) install : - ln -f -s $(shell pwd)/$(EXE).blacklist $(CFGDIR)/$(EXE).blacklist - ln -f -s $(shell pwd)/$(EXE).whitelist $(CFGDIR)/$(EXE).whitelist - ln -f -s $(shell pwd)/$(EXE).interlink $(CFGDIR)/$(EXE).interlink - ln -f -s $(shell pwd)/$(EXE).terminal $(CFGDIR)/$(EXE).terminal - cp -f ../systemd/$(EXE).service /etc/systemd/system/ - cp -f $(EXE) $(BINDIR) + $(CP) ../$(EXE).service /etc/systemd/system/ + $(CP) $(EXE) $(BINDIR) systemctl enable $(EXE).service systemctl daemon-reload systemctl start $(EXE) uninstall : - rm -f $(CFGDIR)/$(EXE).blacklist - rm -f $(CFGDIR)/$(EXE).whitelist - rm -f $(CFGDIR)/$(EXE).interlink - rm -f $(CFGDIR)/$(EXE).terminal systemctl stop $(EXE).service - rm -f $(CFGDIR)/dmrid.dat systemctl disable $(EXE).service - rm -f /etc/systemd/system/$(EXE).service + $(RM) /etc/systemd/system/$(EXE).service systemctl daemon-reload + $(RM) $(BINDIR)/$(EXE) diff --git a/reflector/example.ini b/reflector/example.ini index a8d69a2..cf9ab4b 100644 --- a/reflector/example.ini +++ b/reflector/example.ini @@ -113,7 +113,7 @@ RefreshMin = 191 ######### Other File locations [Files] PidPath = /var/run/urfd.pid -JsonPath = /var/log/urfd.json +ReflStatePath = /var/log/urfd.xml WhitelistPath = /usr/local/etc/urfd.whitelist BlacklistPath = /usr/local/etc/urfd.blacklist InterlinkPath = /usr/local/etc/urfd.interlink