Updates and a new notify script
This commit is contained in:
parent
42b7fc8d26
commit
154ceb9160
1 changed files with 22 additions and 0 deletions
22
bin/notify
Executable file
22
bin/notify
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
$script = array_shift($_SERVER['argv']);
|
||||
$title = array_shift($_SERVER['argv']);
|
||||
$description = array_shift($_SERVER['argv']);
|
||||
|
||||
$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);
|
||||
|
||||
$return = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
$json = json_decode($return, true);
|
||||
|
||||
|
||||
|
||||
if(isset($json['info'])) echo("Result: ${json['info']}");
|
Loading…
Add table
Reference in a new issue