Skip to content

Commit

Permalink
ffwizard: change hasRootPass() to use rpc-call "ffwizard-berlin.has_r…
Browse files Browse the repository at this point in the history
…oot-pass"

This is still not fully functional yet, but shows if the principle will work. 
It's still missing the code to parse the result  into isPasswordSet.
  • Loading branch information
SvenRoederer committed Mar 11, 2019
1 parent a031a73 commit 5facfff
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -69,12 +69,13 @@ function hasRootPass()
logger ("checking for root-password ...")

local isPasswordSet = true
local f = io.popen("wget http://localhost/cgi-bin/has_root-pass -q -O -")
local f = io.popen("wget http://localhost/ubus -q -O - --post-data '{ \"jsonrpc\": \"2.0\", \"method\": \" call\", \"params\": [ \"00000000000000000000000000000000\", \"ffwizard-berlin\", \"has_root-pass\", {} ] }'")
local ret = f:read("*a")
f:close()
logger(ret)
if ret == "password_is_set:no" then
isPasswordSet = false
end
f:close()
return isPasswordSet
end

Expand Down

0 comments on commit 5facfff

Please sign in to comment.