From 2056eaebb11e9a7141b3d3e9f1d42dae3e63f768 Mon Sep 17 00:00:00 2001
From: Clemens John <clemens-john@gmx.de>
Date: Sat, 27 Apr 2013 21:48:17 +0200
Subject: [PATCH] Prepare watchdog for Netmons new REST API

---
 ath9k-watchdog/files/ath9k-watchdog    | 2 +-
 ath9k-watchdog/files/ath9k-watchdog-pm | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ath9k-watchdog/files/ath9k-watchdog b/ath9k-watchdog/files/ath9k-watchdog
index 75b599c..b3c5a4d 100755
--- a/ath9k-watchdog/files/ath9k-watchdog
+++ b/ath9k-watchdog/files/ath9k-watchdog
@@ -17,7 +17,7 @@ do
 
         # Perform post-mortem dump
         tstmp=$(/bin/date +%s)
-        echo -n "hostname=${hostname}&tstmp=${tstmp}" > /tmp/$tstmp
+        echo -n "data[hostname]=${hostname}&data[tstmp]=${tstmp}" > /tmp/$tstmp
         
         # Move into upload directory
         mv  /tmp/$tstmp /usr/lib/ath9k-watchdog
diff --git a/ath9k-watchdog/files/ath9k-watchdog-pm b/ath9k-watchdog/files/ath9k-watchdog-pm
index 87ed9e8..c936f5b 100755
--- a/ath9k-watchdog/files/ath9k-watchdog-pm
+++ b/ath9k-watchdog/files/ath9k-watchdog-pm
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Save log
 mkdir -p /usr/lib/ath9k-watchdog
-UPLOAD_URL="http://[$(uci get configurator.@api[0].ipv6_address)%$(uci get configurator.@api[0].ipv6_interface)]/ath9k-crash/"
+UPLOAD_URL="http://[$(uci get configurator.@api[0].ipv6_address)%$(uci get configurator.@api[0].ipv6_interface)]/api/rest/event/"
 WGETC=$(which wget)
 
 
@@ -12,7 +12,7 @@ cd /usr/lib/ath9k-watchdog
 while [ 1 = 1 ]
 do
 	for f in $(ls .); do 
-        $WGETC -q $UPLOAD_URL?$(cat $f) -O - && rm $f
+		$WGETC -q $UPLOAD_URL"?object=router&object_id="$(uci get configurator.@crawl[0].router_id)"&data[action]=watchdog_ath9k_bug&"$(cat $f) -O - && rm $f
 	done
 	sleep 60
 	# If there are more than 15 files, assume that files cannot be uploaded
-- 
GitLab