Browse Source

Install symbolic link for ckproxy, and automatically start ckpool in ckproxy mode when called by the ckproxy name.

master
ckolivas 5 years ago
parent
commit
4e0e76304d
  1. 6
      src/Makefile.am
  2. 5
      src/ckpool.c

6
src/Makefile.am

@ -40,3 +40,9 @@ ckdb_SOURCES = ckdb.c ckdb_cmd.c ckdb_data.c ckdb_dbio.c ckdb_btc.c \
ckdb_crypt.c ckdb.h klist.c ktree.c klist.h ktree.h
ckdb_LDADD = libckpool.a @JANSSON_LIBS@ @LIBS@
endif
install-exec-hook:
$(LN_S) -f ckpool $(DESTDIR)$(bindir)/ckproxy
uninstall-local:
rm -f $(bindir)/ckproxy

5
src/ckpool.c

@ -1630,6 +1630,7 @@ int main(int argc, char **argv)
struct sigaction handler;
int c, ret, i = 0, j;
char buf[512] = {};
char *appname;
ckpool_t ckp;
/* Make significant floating point errors fatal to avoid subtle bugs being missed */
@ -1646,6 +1647,10 @@ int main(int argc, char **argv)
ckp.initial_args[ckp.args] = strdup(argv[ckp.args]);
ckp.initial_args[ckp.args] = NULL;
appname = basename(argv[0]);
if (!strcmp(appname, "ckproxy"))
ckp.proxy = true;
while ((c = getopt_long(argc, argv, "Ac:Dd:g:HhkLl:Nn:PpqRS:s:tu", long_options, &i)) != -1) {
switch (c) {
case 'A':

Loading…
Cancel
Save