check for missing tokens

This commit is contained in:
Aaron Bieber 2020-07-31 16:13:30 -06:00
parent 127203781b
commit 50c44916ff

View File

@ -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"),