From 197b25b76f19c73b2d58873c1b2fdab7d5a27a85 Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Fri, 22 Mar 2019 00:36:33 +0000 Subject: [PATCH] Ok, swap files... le sigh --- ansible-hook.php | 14 +++++++------- www-hook.php | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ansible-hook.php b/ansible-hook.php index 090d0ac..e1787a3 100644 --- a/ansible-hook.php +++ b/ansible-hook.php @@ -3,8 +3,8 @@ /* security */ $access_token = 'abcdefg'; -$www_lastrun = '/dev/shm/www-hook-last-run'; -$www_dropfile = '/dev/shm/run-www'; +$ansible_lastrun = '/dev/shm/ansible-hook-last-run'; +$ansible_dropfile = '/dev/shm/run-ansible'; $remoteip = $_SERVER['REMOTE_ADDR']; $allowedip = "195.201.242.48"; $ratelimit = 300; @@ -29,11 +29,11 @@ if ($remoteip != $allowedip) die(); } -syslog(LOG_INFO, 'WWW Webhook recieved.'); - if ( time () - filemtime ( $www_lastrun ) > $ratelimit ) { - touch ( $www_dropfile ); - touch ( $www_lastrun ); - echo "HTTP 200 - WWW webhook recieved."; +syslog(LOG_INFO, 'Ansible Webhook recieved.'); + if ( time () - filemtime ( $ansible_lastrun ) > $ratelimit ) { + touch ( $ansible_dropfile ); + touch ( $ansible_lastrun ); + echo "HTTP 200 - Ansible webhook recieved."; die(); } else { diff --git a/www-hook.php b/www-hook.php index e1787a3..090d0ac 100644 --- a/www-hook.php +++ b/www-hook.php @@ -3,8 +3,8 @@ /* security */ $access_token = 'abcdefg'; -$ansible_lastrun = '/dev/shm/ansible-hook-last-run'; -$ansible_dropfile = '/dev/shm/run-ansible'; +$www_lastrun = '/dev/shm/www-hook-last-run'; +$www_dropfile = '/dev/shm/run-www'; $remoteip = $_SERVER['REMOTE_ADDR']; $allowedip = "195.201.242.48"; $ratelimit = 300; @@ -29,11 +29,11 @@ if ($remoteip != $allowedip) die(); } -syslog(LOG_INFO, 'Ansible Webhook recieved.'); - if ( time () - filemtime ( $ansible_lastrun ) > $ratelimit ) { - touch ( $ansible_dropfile ); - touch ( $ansible_lastrun ); - echo "HTTP 200 - Ansible webhook recieved."; +syslog(LOG_INFO, 'WWW Webhook recieved.'); + if ( time () - filemtime ( $www_lastrun ) > $ratelimit ) { + touch ( $www_dropfile ); + touch ( $www_lastrun ); + echo "HTTP 200 - WWW webhook recieved."; die(); } else {