-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') if not mg.request_info.uri:find('/$') and not mg.request_info.uri:lower():find('%.html$') then mg.write(Response(301, nil, nil, 0)..'Location: '..mg.request_info.uri..'/\r\n\r\n') return end ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[ EDCB

メニュー

]=]) post=AssertPost() if post then if mg.get_var(post,'suspend') then --ok=edcb.os.execute('start "SetSuspendState" powershell -NoProfile -Command "&{sleep 5;Add-Type -AssemblyName System.Windows.Forms;[Windows.Forms.Application]::SetSuspendState([Windows.Forms.PowerState]::Suspend,$false,$false)}"') ct:Append('
スタンバイに移行'..(ok and 'します' or 'できません (スクリプトのコメントアウトを解除してください)')..'
\n') elseif mg.get_var(post,'epgcap') then ct:Append('
EPG取得を開始'..(edcb.EpgCapNow() and 'しました' or 'できませんでした')..'
\n') elseif mg.get_var(post,'epgreload') then ct:Append('
EPG再読み込みを開始'..(edcb.ReloadEpg() and 'しました' or 'できませんでした')..'
\n') end end ct:Append([=[
]=]) ct:Finish() mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))