check for missing tokens
This commit is contained in:
parent
127203781b
commit
50c44916ff
9
main.go
9
main.go
@ -48,6 +48,7 @@ func main() {
|
||||
unix.Unveil("", "")
|
||||
unix.PledgePromises("stdio inet dns rpath")
|
||||
|
||||
var token, userToken string
|
||||
var err error
|
||||
var req *http.Request
|
||||
var client = *http.DefaultClient
|
||||
@ -67,6 +68,14 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
token = os.Getenv("PUSHOVER_TOKEN")
|
||||
userToken = os.Getenv("PUSHOVER_USER")
|
||||
|
||||
if token == "" || userToken == "" {
|
||||
fmt.Println("please set PUSHOVER_TOKEN and PUSHOVER_USER")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var push = &Push{
|
||||
Token: os.Getenv("PUSHOVER_TOKEN"),
|
||||
User: os.Getenv("PUSHOVER_USER"),
|
||||
|
Loading…
Reference in New Issue
Block a user