#tradewind:update notify
This commit is contained in:
parent
0d496abee4
commit
8105eb79ca
@ -7,6 +7,7 @@
|
|||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.0",
|
"php": ">=7.1.0",
|
||||||
"cloudflare/sdk": "^1.1"
|
"cloudflare/sdk": "^1.1",
|
||||||
|
"guzzlehttp/guzzle": "~6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,10 +44,17 @@ if (!empty($realIp)) {
|
|||||||
try {
|
try {
|
||||||
$dns->updateRecordDetails($zoneID, $recordId, $details);
|
$dns->updateRecordDetails($zoneID, $recordId, $details);
|
||||||
|
|
||||||
$cmd = <<< CMD
|
$url = 'https://sc.ftqq.com/' . $globalConfig['serverchan_token'] . '.send';
|
||||||
curl -s 'https://oapi.dingtalk.com/robot/send?access_token={$globalConfig['dingtalk_token']}' -H 'Content-Type: application/json' -d "{\"msgtype\": \"text\",\"text\": {\"content\": \"$msg\"}}"
|
|
||||||
CMD;
|
$client = new \GuzzleHttp\Client();
|
||||||
shell_exec($cmd);
|
$client->request('POST', $url, [
|
||||||
|
'text' => 'IP变更',
|
||||||
|
'desc' => $msg,
|
||||||
|
]);
|
||||||
|
// $cmd = <<< CMD
|
||||||
|
//curl -s 'https://oapi.dingtalk.com/robot/send?access_token={$globalConfig['dingtalk_token']}' -H 'Content-Type: application/json' -d "{\"msgtype\": \"text\",\"text\": {\"content\": \"$msg\"}}"
|
||||||
|
//CMD;
|
||||||
|
// shell_exec($cmd);
|
||||||
|
|
||||||
logMessage('SUCCESS', $msg);
|
logMessage('SUCCESS', $msg);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -61,6 +68,27 @@ CMD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function sc_send($text, $desp = '', $key = 'SCU159053T3de1450d55d3b894e39c7a2ecd583984601fce6865119')
|
||||||
|
{
|
||||||
|
$postdata = http_build_query(
|
||||||
|
array(
|
||||||
|
'text' => $text,
|
||||||
|
'desp' => $desp
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$opts = array('http' =>
|
||||||
|
array(
|
||||||
|
'method' => 'POST',
|
||||||
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
|
'content' => $postdata
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
return $result = file_get_contents('https://sc.ftqq.com/' . $key . '.send', false, $context);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function logMessage($type, $msg = '')
|
function logMessage($type, $msg = '')
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user