Send the hostname as the first line

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-04 15:08:25 -07:00
parent d767632eed
commit 678d005061
3 changed files with 14 additions and 7 deletions

View File

@ -3,9 +3,7 @@ DNSNAME = $(shell hostname -f)
# check if DNSNAME is a FQDN # check if DNSNAME is a FQDN
all: all:
# 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file # make push
# go get -u github.com/maxcnunes/gaper
# gaper
push: push:
git pull git pull

View File

@ -2,7 +2,13 @@ DNSNAME = $(shell hostname -f)
# check if DNSNAME is a FQDN # 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 # 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file
# go get -u github.com/maxcnunes/gaper # go get -u github.com/maxcnunes/gaper
gaper gaper
ipv6-delete:
ip addr del 2600:1700:da80:8510::2c dev wifi0

View File

@ -6,7 +6,7 @@ import "bufio"
import "os" import "os"
const ( const (
CONN_HOST = "localhost" CONN_HOST = "fire.lab.wit.com"
CONN_PORT = "3333" CONN_PORT = "3333"
CONN_PROTO = "tcp" CONN_PROTO = "tcp"
) )
@ -17,9 +17,12 @@ func main() {
// connect to this socket // connect to this socket
conn, _ := net.Dial(CONN_PROTO, CONN_HOST+":"+CONN_PORT) 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 { for {
// read in input from stdin
reader := bufio.NewReader(os.Stdin)
fmt.Print("Text to send: ") fmt.Print("Text to send: ")
text, _ := reader.ReadString('\n') text, _ := reader.ReadString('\n')
// send to socket // send to socket