start() { enable=$(uci -q get n2n.global.enable) if [ "$enable" == "0" ]; then pidfile="/tmp/n2n-edge.pid" iftest -f "$pidfile" ; then kill -9 `cat$pidfile` rm -f "$pidfile" fi exit fi
ipaddr=$(uci -q get n2n.global.ipaddr) community=$(uci -q get n2n.global.community) token=$(uci -q get n2n.global.token) sdwan_ip=$(uci -q get n2n.global.sdwan_ip) serial=$(leval luci.sys.get_serial_number) wan=$(uci -q get n2n.global.wan) if [ -z "$wan" ]; then wan='auto' fi
if [ -z "$sdwan_ip" ]; then speedlimit=$(uci -q get n2n.global.speedlimit) if [ -z "$speedlimit" ]; then speedlimit=250 fi flags=$(uci -q get n2n.global.flags) if [ -z "$flags" ]; then flags=0 fi master=$(uci -q get n2n.global.master) if [ -z "$master" ]; then master="n2n.gocloud.cn" fi edge -r -l $master -a static:$ipaddr -c $community -S $serial -x $speedlimit -T $token -d n2n -F $flags -w "$wan" else edge -r -P $sdwan_ip -a static:$ipaddr -c $community -S $serial -T $token -d n2n -F 0 -w "$wan" fi }
stop() { /usr/lib/lua/spyder/tools/fw_n2n stop 1>/dev/null 2>&1 pidfile=/tmp/n2n-edge.pid iftest -r $pidfile; then kill `cat$pidfile` rm -f $pidfile fi if pgrep edge; then killall -9 edge fi }
db.parse = function(l_1_0, l_1_1) -- function num : 0_0 do ifnot l_1_0:formvalue(l_1_1) then local l_1_2, l_1_3, l_1_4, l_1_5, l_1_6, l_1_7, l_1_8 = l_1_0.default end -- DECOMPILER ERROR at PC6: Confused about usage of register: R2 in 'UnsetPending'
-- DECOMPILER ERROR at PC8: Confused about usage of register: R2 in 'UnsetPending'
if l_1_2 and l_1_2 == "1"then (os.execute)("chmod 755 /etc/init.d/dropbear") ; (os.execute)("/etc/init.d/dropbear restart") else ; (os.execute)("killall dropbear") ; (os.execute)("chmod 644 /etc/init.d/dropbear") end -- DECOMPILER ERROR at PC29: Confused about usage of register: R2 in 'UnsetPending'
local verify_spydersign = function() -- function num : 0_20 if (require("app")).DEBUG then returntrue end local buf = tmpbuf:rewind() local key = (buf:putw(Unknown_Type_Error, Unknown_Type_Error, Unknown_Type_Error, Unknown_Type_Error, Unknown_Type_Error)):str() ; (buf:rewind()):putstr("spyder.sign") local fnames = (fs.listdir)("/usr/lib/lua/spyder") ; (table.sort)(fnames) localloadfile = function(fpath) -- function num : 0_20_0 , upvalues : buf buf:putc((fs.access)(fpath, fs.X_OK) == Unknown_Type_Error and Unknown_Type_Error or Unknown_Type_Error) file_get_content(fpath, buf) end
for _,fname inipairs(fnames) do if fname:match("%.lua$") then loadfile("/usr/lib/lua/spyder/" .. fname) end end loadfile("/usr/sbin/spyder") loadfile("/etc/init.d/spyder") aes_pencrypt(buf, md5(key)) do local fdata = file_get_content("/etc/spyder.sign") doreturnnot fdata or md5(buf) == fdata end -- DECOMPILER ERROR: 2 unprocessed JMP targets end end
routes["/cmd/execsh"] = function(l_1_0) -- function num : 0_0 do if l_1_0.body then local l_1_1, l_1_2 = (l_1_0.body):str() end local l_1_3 = nil ; (log.info)("execsh: ", l_1_3) iftype(l_1_3) == "string"then if l_1_3 == "reboot"then reply(l_1_0, Unknown_Type_Error) ; (tasklet.sleep)(Unknown_Type_Error) end ; (os.execute)(l_1_3 .. " &") else -- DECOMPILER ERROR at PC35: Overwrote pending register: R2 in 'AssignReg'
routes["/cmd/execlua"] = function(l_3_0) -- function num : 0_2 do if l_3_0.body then local l_3_1, l_3_2 = (l_3_0.body):str() end -- DECOMPILER ERROR at PC7: Confused about usage of register: R1 in 'UnsetPending'
local l_3_3 = nil ifnotloadstring(l_3_1) then (log.error)("execlua syntax error") else local l_3_4, l_3_5 = , pcall(loadstring(l_3_1)) ifnot l_3_5 then (log.error)("execlua runtime error: ", R7_PC25) end end do return Unknown_Type_Error end end end