Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/lua
- print"Content-type: text/html"
- local arg={}
- local qs=os.getenv"QUERY_STRING" or ""
- for p in qs:gmatch"[^&]*" do -- seems to get all of the html arguments passed in
- local k,v=p:match"([^=]*)=(.*)"
- if k then
- arg[k]=v
- else
- table.insert(arg,p)
- end
- end
- local f=io.open("/var/www/jacob1/log.log","a") -- log request types, ip adresses, and mod versions of all requests
- f:write(("%s\t%s\t%s\t%s\t%s\n"):format(arg.Action or "None",arg.Architecture or "None",arg.InstructionSet or "None",os.getenv"REMOTE_ADDR" or "None",os.getenv"HTTP_X_J1Mod_VERSION" or "None"))",os.getenv"HTTP_X_Auth_User" or "None"))
- f:close()
- if arg.Action=="CheckVersion" then -- return the changelog, or the default 0 0 0 one if there is no changelog by that name
- local f=io.open(("Changelog_%s_%s.txt"):format(arg.Architecture or "Unknown",arg.InstructionSet or "Unknown")) or io.open"Changelog_Default.txt"
- local d=f:read"*a"
- print(("Content-Length: %d\n"):format(#d))
- io.write(d)
- elseif arg.Action=="Download" then -- return the update
- local d=io.open(("Update_%s_%s"):format(arg.Architecture or "Unknown",arg.InstructionSet or "Unknown")):read"*a"
- print(("Content-Length: %d\n"):format(#d))
- io.write(d)
- else
- io.write"\nHello?" -- if no args, probably someone just clicked the link from a browser
- end
- sample changelog:
- 4 20 3
- tIncrease the speed of the save browser and fix ancient missing thumbnail bug
- gCompatibility with tpt++ powder.pref's (won't delete it's settings)
- tFix ANIM pause bugs and some editing bugs
- gAdd in many tpt++ element fixes
- tFix differences in what can destroy elements between this and tpt
- gHold ctrl when selecting a stamp to not reorder the list
- tVersion 20.3: Fix crash glitch caused by my tpt++ STKM eaten by CONV fix
- this says build 4, version 20.3. Then each line uses tpt's color format, that is what the g's and t's are. They should probably be deleted. This is titled Changelog_Windows32_SSE2.txt. You also need a Changelog_Default.txt that just says "0 0 0"
Advertisement
Add Comment
Please, Sign In to add comment