From 678d0050616490801da504fb69f15e10a3d52bed Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 4 May 2019 15:08:25 -0700 Subject: [PATCH] Send the hostname as the first line Signed-off-by: Jeff Carr --- Makefile | 4 +--- client/Makefile | 8 +++++++- client/client.go | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 8803001..5eeb6d7 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,7 @@ DNSNAME = $(shell hostname -f) # check if DNSNAME is a FQDN all: - # 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file - # go get -u github.com/maxcnunes/gaper - # gaper + # make push push: git pull diff --git a/client/Makefile b/client/Makefile index 196fd8f..382b55e 100644 --- a/client/Makefile +++ b/client/Makefile @@ -2,7 +2,13 @@ DNSNAME = $(shell hostname -f) # check if DNSNAME is a FQDN -all: +run: + go run *.go + +gaper: # 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file # go get -u github.com/maxcnunes/gaper gaper + +ipv6-delete: + ip addr del 2600:1700:da80:8510::2c dev wifi0 diff --git a/client/client.go b/client/client.go index b05a7a7..c2b48f6 100644 --- a/client/client.go +++ b/client/client.go @@ -6,7 +6,7 @@ import "bufio" import "os" const ( - CONN_HOST = "localhost" + CONN_HOST = "fire.lab.wit.com" CONN_PORT = "3333" CONN_PROTO = "tcp" ) @@ -17,9 +17,12 @@ func main() { // connect to this socket conn, _ := net.Dial(CONN_PROTO, CONN_HOST+":"+CONN_PORT) + // read in input from stdin + reader := bufio.NewReader(os.Stdin) + + fmt.Fprintf(conn,"librem15.lab.wit.com\n") + for { - // read in input from stdin - reader := bufio.NewReader(os.Stdin) fmt.Print("Text to send: ") text, _ := reader.ReadString('\n') // send to socket