Wer statt Whatsapp zb Pushbullet nutzen will, kann das auch so machen:
sudo nano /opt/pushbullet.php
Folgendes einfügen:
<?php
function pushbullet($msg){
$data = json_encode(array(
'type' => 'note',
'title' => 'NOTIFICATION ALERT',
'body' => $msg,
'iden' => "DEIN-HANDY-NAME"
));
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, '
https://api.pushbullet.com/v2/pushes');
curl_setopt($curl, CURLOPT_USERPWD, 'DEIN-TOKEN');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Content-Length: ' . strlen($data)]);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
if(curl_exec($curl) === false) {
echo 'Curl-Fehler: ' . curl_error($curl);
}
curl_close($curl);
}
pushbullet($argv[1]);
?>
-------
Dabei muss DEIN-HANDY-NAME und DEIN-TOKEN so gesetzt sein, wie es in Pushbullet vergeben ist.
Danach noch die Whatsapp-Auslöser-Datei ändern
sudo nano /usr/sbin/sende_whatsapp.sh
Alles darin auskommentieren und am Schluss die folgende Zeile reinmachen
php /opt/pushbullet.php "$2"
Im Webinterface dann Whatsapp aktivieren - danach wird per PushBullet versendet.