mirror of
https://github.com/KevinMidboe/motdGO.git
synced 2025-10-29 17:50:24 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b8bd4207e | |||
| 29281cd6e4 | |||
| fe2962b1f7 | |||
| 5bbad6bf29 | |||
| e6104e279f |
6
Makefile
6
Makefile
@@ -9,6 +9,12 @@ build:
|
|||||||
go mod vendor; \
|
go mod vendor; \
|
||||||
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o motd cmd/motdGO/main.go
|
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:
|
install:
|
||||||
export GO11MODULE="on"; \
|
export GO11MODULE="on"; \
|
||||||
go mod tidy; \
|
go mod tidy; \
|
||||||
|
|||||||
@@ -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.
|
`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.
|
With `motdGO` it's easy to create **ascii text banners for motd** in the command-line or with the given api.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Build locally
|
## Build locally
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@ Download and run binary:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget 'https://raw.githubusercontent.com/kevinmidboe/motdGO/main/motd'
|
wget 'https://raw.githubusercontent.com/kevinmidboe/motdGO/main/motd'
|
||||||
|
chmod +x motd
|
||||||
./motd -str 'hello world'
|
./motd -str 'hello world'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var (
|
|||||||
font *string = flag.String("font", "", "Font name to use")
|
font *string = flag.String("font", "", "Font name to use")
|
||||||
fontpath *string = flag.String("fontpath", "", "Font path to load fonts from")
|
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')")
|
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")
|
file *string = flag.String("file", "", "File to write to")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
BIN
motd-linux
Executable file
BIN
motd-linux
Executable file
Binary file not shown.
@@ -22,6 +22,8 @@ var parsers map[string]Parser = map[string]Parser{
|
|||||||
"terminal": {"terminal", "", "", "\n", nil},
|
"terminal": {"terminal", "", "", "\n", nil},
|
||||||
// Parser for HTML code
|
// Parser for HTML code
|
||||||
"html": {"html", "<code>", "</code>", "<br>", map[string]string{" ": " "}},
|
"html": {"html", "<code>", "</code>", "<br>", map[string]string{" ": " "}},
|
||||||
|
// Parser for motd file
|
||||||
|
"motd": {"motd", "#!/bin/sh\ncat << 'EOF'\n", "EOF", "\n", nil},
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetParser returns a parser by its key
|
// GetParser returns a parser by its key
|
||||||
|
|||||||
Reference in New Issue
Block a user