diff --git a/README.md b/README.md index 03748d3..cd11766 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,29 @@ This application "pings" websites every few minutes (to be set in config). It ca * 💻 Linux amd64 * [Download](https://github.com/MedzikUser/go-pingbot/releases) latest version - * Unpack file `tar xzf pingbot_{VERSION}_linux_amd64.tar.gz` - * Create an .env and config.toml file and complete according to .env.schema and config.schema.toml - * Add permissions `chmod +rwx pingbot.out` - * Run binary `./pingbot.out` + * Unpack file `tar xzf pingbot_*_linux_amd64.tar.gz` + * Done your binary is `pingbot.out` + +## Compile from Source Code +Not recommended because automatic updates don't work + +### Requirements + +* [Go](https://golang.org/dl) (recommended latest version) + +### Compile + +* Download source code `git clone https://github.com/MedzikUser/go-pingbot.git --depth 1` +* Go to folder with source code `cd go-pingbot` +* Download dependencies `go mod tidy` +* Build `go build -o pingbot.out` +* Done your compined binary is `pingbot.out` + +## Configurate + +* Complete .env according to .env.schema +* And fill in config.toml according to config.schema.toml + +## Run + +* `./pingbot.out` diff --git a/main.go b/main.go index 1915f08..b68812f 100644 --- a/main.go +++ b/main.go @@ -42,14 +42,15 @@ func main() { client := updater.Client{ GitHub: config.GH_Repo, GitHubToken: config.GH_Token, - CheckEvery: config.Toml.AutoUpdate.Check * time.Minute, Version: config.Version, Binary: "pingbot.out", + CheckEvery: config.Toml.AutoUpdate.Check * time.Minute, AfterUpdate: func() { log.Info("Updated!") os.Exit(1) }, + Major: false, } go client.AutoUpdater() diff --git a/nodemon.sh b/nodemon.sh index 29bd2d6..c64ce2b 100755 --- a/nodemon.sh +++ b/nodemon.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash # Colors -red="\e[0;91m" -reset="\e[0m" +RED="\e[0;91m" +NC="\e[0m" # No Color if ! go build -o pingbot.out; then - echo -e "${reset}[${red}COMPILE ERROR${reset}]" + echo -e "${reset}[${RED}COMPILE ERROR${NC}]" exit 1 else if ! ./pingbot.out; then - echo -e "${reset}[${red}PROGRAM PANIC${reset}]" + echo -e "${reset}[${RED}PROGRAM PANIC${NC}]" exit 1 else - echo -e "${reset}[${red}PROGRAM END${reset}]" + echo -e "${reset}[${RED}PROGRAM END${NC}]" fi fi