Add a script to trigger target to send status update
This commit is contained in:
parent
e890afb4f5
commit
889a773d87
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -11,6 +11,9 @@ Thumbs.db
|
|||
# The active config file copied from config-dist.php
|
||||
config.php
|
||||
|
||||
# The button log
|
||||
buttonlog.txt
|
||||
|
||||
# Vim
|
||||
*.swp
|
||||
*.swo
|
||||
|
|
|
|||
26
requeststatus.php
Normal file
26
requeststatus.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
require "header.php";
|
||||
|
||||
function usage() {
|
||||
echo "Usage: requeststatus.php <idmask>\n";
|
||||
echo "";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( php_sapi_name() != "cli" ) exit();
|
||||
|
||||
if ( $argc != 2 ) usage();
|
||||
|
||||
$idmask = intval($argv[1]);
|
||||
if ( ($idmask <= 0) || ($idmask > 31) ) usage();
|
||||
|
||||
$command = 0x04;
|
||||
$target = $idmask;
|
||||
$unique = mt_rand(1, 2000000000);
|
||||
|
||||
$data = pack("LLLCL", PACKETFILTER[0], PACKETFILTER[1], $unique, $command, $target);
|
||||
|
||||
transmitMessage($data);
|
||||
|
||||
exit();
|
||||
Loading…
Reference in New Issue
Block a user