From 20dae8620634bee86b277f9c6211e2d69ba0a3af Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 4 Mar 2020 07:01:35 -0700 Subject: [PATCH] move exec_?X.sh scripts to --- Makefile | 8 ++++---- QnetLink.cpp | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0a61f99..a8258b8 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,10 @@ SYSDIR=/lib/systemd/system IRC=ircddb # use this if you want debugging help in the case of a crash -#CPPFLAGS=-g -ggdb -W -Wall -std=c++11 -Iircddb -DCFG_DIR=\"$(CFGDIR)\" +#CPPFLAGS=-g -ggdb -W -Wall -std=c++11 -Iircddb -DCFG_DIR=\"$(CFGDIR)\" -DBIN_DIR=\"$(BINDIR)\" # or, you can choose this for a much smaller executable without debugging help -CPPFLAGS=-W -Wall -std=c++11 -Iircddb -DCFG_DIR=\"$(CFGDIR)\" +CPPFLAGS=-W -Wall -std=c++11 -Iircddb -DCFG_DIR=\"$(CFGDIR)\" -DBIN_DIR=\"$(BINDIR)\" LDFLAGS=-L/usr/lib -lrt @@ -106,7 +106,7 @@ installbase : $(BASE_PROGRAMS) gwys.txt qn.cfg /bin/cp -f qnlink $(BINDIR) /bin/cp -f announce/*.dat $(CFGDIR) /bin/ln -s $(shell pwd)/gwys.txt $(CFGDIR) - /bin/cp -f exec_?.sh $(CFGDIR) + /bin/cp -f exec_?.sh $(BINDIR) /bin/cp -f system/qnlink.service $(SYSDIR) systemctl enable qnlink.service systemctl daemon-reload @@ -196,7 +196,7 @@ uninstallbase : /bin/rm -f $(CFGDIR)/*.dat /bin/rm -f $(CFGDIR)/RPT_STATUS.txt /bin/rm -f $(CFGDIR)/gwys.txt - /bin/rm -f $(CFGDIR)/exec_?.sh + /bin/rm -f $(BINDIR)/exec_?.sh uninstallrelay : ######### QnetRelay ######### diff --git a/QnetLink.cpp b/QnetLink.cpp index 28783ee..43c0f38 100644 --- a/QnetLink.cpp +++ b/QnetLink.cpp @@ -53,6 +53,9 @@ #include "QnetLink.h" #define LINK_VERSION "QnetLink-7.2" +#ifndef BIN_DIR +#define BIN_DIR "/usr/local/bin" +#endif std::atomic CQnetLink::keep_running(true); @@ -2898,7 +2901,7 @@ void CQnetLink::Process() } if (user_ok) { memset(system_cmd, '\0', sizeof(system_cmd)); - snprintf(system_cmd, FILENAME_MAX, "%s/exec_%c.sh %s %c &", announce_dir.c_str(), dsvt.hdr.urcall[6], call, dsvt.hdr.rpt1[7]); + snprintf(system_cmd, FILENAME_MAX, "%s/exec_%c.sh %s %c &", BIN_DIR, dsvt.hdr.urcall[6], call, dsvt.hdr.rpt1[7]); printf("Executing %s\n", system_cmd); system(system_cmd); }