-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
44 lines (32 loc) · 748 Bytes
/
main.go
File metadata and controls
44 lines (32 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"os"
"github.com/NETWAYS/go-check"
)
const readme = `Notifications via a brevis.one gateway.
Sends SMS or rings at a given number
https://github.com/NETWAYS/notify-brevisone`
func main() {
defer check.CatchPanic()
plugin := check.NewConfig()
plugin.Name = "notify-brevisone"
plugin.Readme = readme
plugin.Timeout = 30
plugin.Version = buildVersion()
config := &Config{}
config.BindArguments(plugin.FlagSet)
plugin.ParseArguments()
if len(os.Args) <= 1 {
plugin.FlagSet.Usage()
check.ExitRaw(check.Unknown, "No arguments given")
}
err := config.Validate()
if err != nil {
check.ExitError(err)
}
err = config.Run()
if err != nil {
check.ExitError(err)
}
check.ExitRaw(check.OK, "done")
}