Updated notify script

This commit is contained in:
Nikolas Weger 2018-05-30 12:14:42 +02:00
parent 1b69545c09
commit 6c5938990e

View file

@ -1,13 +1,14 @@
#!/usr/bin/php
<?php
$script = array_shift($_SERVER['argv']);
$title = array_shift($_SERVER['argv']);
$description = array_shift($_SERVER['argv']);
$settings['token'] = 'ayndqf6fdyjo9pua8reusvvb733k1u';
$settings['user'] = 'uesmxehx2bcuyv5prfrw39ema2312f';
$settings['title'] = array_shift($_SERVER['argv']);
$settings['message'] = array_shift($_SERVER['argv']);
$settings['priority'] = 1;
$curl = curl_init("https://api.pushover.net/1/messages.json");
$settings = array('token' => 'ayndqf6fdyjo9pua8reusvvb733k1u', 'user' => 'uesmxehx2bcuyv5prfrw39ema2312f', 'message' => $description, 'title' => $title, 'priority' => 1);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $settings);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
@ -17,6 +18,4 @@ curl_close($curl);
$json = json_decode($return, true);
if(isset($json['info'])) echo("Result: ${json['info']}");