boomx

HC2-Reboot

Jan 11th, 2016
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. %% properties
  3.  
  4.  
  5. %% globals
  6.  
  7. --]]
  8.  
  9. function postMethod(data)
  10.     local http = net.HTTPClient()
  11.  
  12.       http:request("http://127.0.0.1:11111/api/settings/reboot", {
  13.         options = {
  14.             method = 'POST',
  15.               headers = {},
  16.               data = data.payload,
  17.               timeout = data.timeout or 5000 },
  18.         success = data.success,
  19.           error = function(err)
  20.             print('[ERROR] ' .. err)
  21.         end
  22.     })
  23. end
  24.    
  25.     fibaro:debug("HC2 wird jetzt neu gestartet...")
  26.     fibaro:sleep(3000)
  27.     postMethod("reboot")
RAW Paste Data