Compare commits

5 Commits
v1.0.0 ... main

Author SHA1 Message Date
3b8bd4207e Updated binary 2024-05-20 19:43:34 +02:00
29281cd6e4 Added motd parser 2024-05-20 19:43:05 +02:00
fe2962b1f7 Compiled for linux amd64 2024-05-20 18:43:55 +02:00
5bbad6bf29 Update binary permissions after download 2023-08-13 20:16:22 +02:00
e6104e279f Update image filename 2023-08-13 20:15:06 +02:00
6 changed files with 11 additions and 2 deletions

View File

@@ -9,6 +9,12 @@ build:
go mod vendor; \
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o motd cmd/motdGO/main.go
build-linux:
export GO11MODULE="auto" \
go mod download; \
go mod vendor; \
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o motd-linux cmd/motdGO/main.go
install:
export GO11MODULE="on"; \
go mod tidy; \

View File

@@ -5,7 +5,7 @@
`motdGO` is a library based on [figlet4go](https://github.com/mbndr/figlet4go) which is a go library which is a port of [FIGlet](http://www.figlet.org/) to Golang.
With `motdGO` it's easy to create **ascii text banners for motd** in the command-line or with the given api.
![screenshot](./screenshot/motdGO.png)
![screenshot](./screenshot/figlet4go.png)
## Build locally
@@ -26,6 +26,7 @@ Download and run binary:
```bash
wget 'https://raw.githubusercontent.com/kevinmidboe/motdGO/main/motd'
chmod +x motd
./motd -str 'hello world'
```

View File

@@ -14,7 +14,7 @@ var (
font *string = flag.String("font", "", "Font name to use")
fontpath *string = flag.String("fontpath", "", "Font path to load fonts from")
colors *string = flag.String("colors", "", "Character colors separated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white, or any hexcode (f.e. '885DBA')")
parser *string = flag.String("parser", "terminal", "Parser to use\tPossible parsers: terminal, html")
parser *string = flag.String("parser", "terminal", "Parser to use\tPossible parsers: terminal, html, motd")
file *string = flag.String("file", "", "File to write to")
)

BIN
motd

Binary file not shown.

BIN
motd-linux Executable file

Binary file not shown.

View File

@@ -22,6 +22,8 @@ var parsers map[string]Parser = map[string]Parser{
"terminal": {"terminal", "", "", "\n", nil},
// Parser for HTML code
"html": {"html", "<code>", "</code>", "<br>", map[string]string{" ": "&nbsp;"}},
// Parser for motd file
"motd": {"motd", "#!/bin/sh\ncat << 'EOF'\n", "EOF", "\n", nil},
}
// GetParser returns a parser by its key