mirror of https://github.com/dirtbags/moth.git
make octopus use a changeable token
This commit is contained in:
parent
5e725489a1
commit
e9bb082a1f
|
@ -5,6 +5,7 @@ octopus-install: octopus-build
|
||||||
|
|
||||||
$(call COPYTREE, packages/octopus/service, $(OCTOPUS_PKGDIR)/service)
|
$(call COPYTREE, packages/octopus/service, $(OCTOPUS_PKGDIR)/service)
|
||||||
|
|
||||||
|
cp packages/octopus/tokens.txt $(OCTOPUS_PKGDIR)/
|
||||||
cp packages/octopus/src/octopus $(OCTOPUS_PKGDIR)/bin/
|
cp packages/octopus/src/octopus $(OCTOPUS_PKGDIR)/bin/
|
||||||
|
|
||||||
octopus-clean:
|
octopus-clean:
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
IP=$(cat ip.txt)
|
|
||||||
ip addr del $IP dev eth0
|
|
|
@ -3,6 +3,6 @@
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
IP=$(cat ip.txt)
|
IP=$(cat ip.txt)
|
||||||
ip addr add $IP dev eth0
|
ip addr add $IP dev eth0 || true
|
||||||
ip monitor | grep -q $IP
|
|
||||||
exec /opt/octopus/bin/octopus ${IP%/*}
|
exec /opt/octopus/bin/octopus ${IP%/*} < /opt/octopus/tokens.txt
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
#define max(a,b) (((a)>(b))?(a):(b))
|
#define max(a,b) (((a)>(b))?(a):(b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char token[] = "octopus:xylep-radar-nanox";
|
const char token[100];
|
||||||
const size_t tokenlen = sizeof(token) - 1;
|
size_t tokenlen;
|
||||||
|
|
||||||
char const octopus[] =
|
char const octopus[] =
|
||||||
(" ___\n"
|
(" ___\n"
|
||||||
|
@ -338,6 +338,12 @@ main(int argc, char *argv[])
|
||||||
memcpy(&addr, &in6addr_any, sizeof addr);
|
memcpy(&addr, &in6addr_any, sizeof addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NULL == fgets(token, sizeof(token), stdin)) {
|
||||||
|
perror("Unable to read token");
|
||||||
|
return EX_IOERR;
|
||||||
|
}
|
||||||
|
tokenlen = strlen(token);
|
||||||
|
|
||||||
bound_ports[0].fd = socket(AF_INET6, SOCK_DGRAM, 0);
|
bound_ports[0].fd = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||||
ret = bind_port(&addr, bound_ports[0].fd, 8888);
|
ret = bind_port(&addr, bound_ports[0].fd, 8888);
|
||||||
if (-1 == ret) {
|
if (-1 == ret) {
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
net:xemim-civiz-tyrox
|
Loading…
Reference in New Issue