forked from thunix/www
Cleaned up a bit
This commit is contained in:
parent
9ea257452b
commit
ad73b30665
|
@ -5,6 +5,7 @@
|
|||
/* security */
|
||||
$access_token = '1234567890';
|
||||
$lastrun = '/tmp/ansible-hook-last-run';
|
||||
$dropfile = '/tmp/run-ansible';
|
||||
|
||||
/* get json data */
|
||||
$json = file_get_contents('php://input');
|
||||
|
@ -24,7 +25,7 @@ syslog(LOG_INFO, 'Ansible Webhook recieved.');
|
|||
|
||||
|
||||
if ( time () - filemtime ( $lastrun ) > 300 ) {
|
||||
exec("/usr/bin/touch /tmp/run_ansible");
|
||||
touch ( $dopfile );
|
||||
touch ( $lastrun );
|
||||
echo "HTTP 200 - Ansible webhook recieved.";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue