daily pastebin goal


a guest Sep 16th, 2010 2,137 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. root@OpenWrt:~# opkg install uhttpd-mod-lua
  2. Installing uhttpd-mod-lua (18) to root...
  3. Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/uhttpd-mod-lua_18_ar71xx.ipk.
  4. Configuring uhttpd-mod-lua.
  5. root@OpenWrt:~# uci set uhttpd.main.lua_prefix=/lua
  6. root@OpenWrt:~# uci set uhttpd.main.lua_handler=/root/test.lua
  7. root@OpenWrt:~# cat /root/test.lua
  8. function handle_request(env)
  9.         uhttpd.send("HTTP/1.0 200 OK\r\n")
  10.         uhttpd.send("Content-Type: text/plain\r\n\r\n")
  11.         uhttpd.send("Hello world.\n")
  12. end
  13. root@OpenWrt:~# /etc/init.d/uhttpd restart
  14. root@OpenWrt:~# wget -qO-
  15. Hello world.
  16. root@OpenWrt:~#
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand