teslamint
teslamint
Reputation Top 1%
Jaehoon You
15 Snippets  (53rd place)
Published
1 Channel
Created
5 Channels
Following
345 points  (88th place)
Reputation
Top 10% Publisher
Junior Code Generator
Serious Code Generator
Junior Popular Coder
Serious Popular Coder
Junior Autobiographer
Serious Autobiographer
Master Autobiographer
Junior Snip2Coder
Junior Famous Coder
Serious Famous Coder
Senior Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by teslamint

public by lneoe  1882  0  3  0

my .screenrc

my .screenrc: .screenrc
# Bind F11 and F12 (NOT F1 and F2) to previous and next screen window
bindkey -k F1 prev
bindkey -k F2 next

startup_message off

# Window list at the bottom.
hardstatus alwayslastline
hardstatus string "%-w%{= BW}%50>%n %t%{-}%+w%<"

# From Stephen Shirley
# Don't block command output if the terminal stops responding
# (like if the ssh connection times out for example).
nonblock on

# Allow editors etc. to restore display on exit
# rather than leaving existing text in place
altscreen on

# Enable 256-color mode when screen is started with TERM=xterm-256color
# Taken from: http://frexx.de/xterm-256-notes/
#
# Note that TERM != "xterm-256color" within a screen window. Rather it is
# "screen" or "screen-bce"
# 
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
#termcapinfo xterm-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'

# scrollback buff, 50000 lines
defscrollback 1000

# no delay when entering copy mode
msgminwait 0

# allow Shift+Page Up/Down
termcapinfo xterm ti@:te@
termcapinfo xterm-color ti@:te@

;

public by teslamint  225884  1  4  0

[PATCH][package] AA: update coova-chilli to 1.3.0 and add kmod-coova package

[PATCH][package] AA: update coova-chilli to 1.3.0 and add kmod-coova package: 0001-update-coova-chilli-to-1.3.0-add-kmod-coova-package.patch
From 2a7568d17915edd283a71f4cc4d4c71d066df912 Mon Sep 17 00:00:00 2001
From: Jaehoon You <jhyou@waffle.at>
Date: Fri, 25 Apr 2014 17:00:48 +0900
Subject: [PATCH] update coova-chilli to 1.3.0; add kmod-coova package;

Based on David Bird's patch: https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html

Signed-off-by: Jaehoon You <teslamint@gmail.com> 

---
 net/coova-chilli/Config.in                         | 56 +++++++++++++
 net/coova-chilli/Makefile                          | 94 ++++++++++++++++++++--
 net/coova-chilli/files/chilli.firewall             | 41 ++++++++++
 net/coova-chilli/files/chilli.init                 | 61 ++++++++++++++
 .../patches/100-fix-sysinfo-redeclaration.patch    | 24 ++++++
 .../patches/200-fix_compile_kmod.patch             | 24 ++++++
 6 files changed, 292 insertions(+), 8 deletions(-)
 create mode 100644 net/coova-chilli/Config.in
 create mode 100644 net/coova-chilli/files/chilli.firewall
 create mode 100644 net/coova-chilli/files/chilli.init
 create mode 100644 net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch
 create mode 100644 net/coova-chilli/patches/200-fix_compile_kmod.patch

diff --git a/net/coova-chilli/Config.in b/net/coova-chilli/Config.in
new file mode 100644
index 0000000..8057d87
--- /dev/null
+++ b/net/coova-chilli/Config.in
@@ -0,0 +1,56 @@
+# CoovaChilli advanced configuration
+
+menu "Configuration"
+       depends on PACKAGE_coova-chilli
+
+config COOVACHILLI_REDIR
+       bool "Enable support for redir server. Required for uamregex"
+       default n
+
+config COOVACHILLI_MINIPORTAL
+       bool "Enable support Coova miniportal"
+       default n
+
+config COOVACHILLI_USERAGENT
+       bool "Enable recording user-agent"
+       default n
+
+config COOVACHILLI_DNSLOG
+       bool "Enable support to log DNS name queries"
+       default n
+
+config COOVACHILLI_UAMDOMAINFILE
+       bool "Enable loading of mass uamdomains from file"
+       default n
+
+config COOVACHILLI_PROXY
+       bool "Enable proxy"
+       default n
+
+config COOVACHILLI_MINICONFIG
+       bool "Enable mini configuration file"
+       default n
+
+config COOVACHILLI_BINSTATUSFILE
+       bool "Enable binary status file"
+       default n
+
+choice
+       prompt "SSL library"
+       default COOVACHILLI_NOSSL
+
+config COOVACHILLI_NOSSL
+       bool "No SSL support"
+
+config COOVACHILLI_MATRIXSSL
+       bool "MatrixSSL"
+
+config COOVACHILLI_CYASSL
+       bool "CyaSSL"
+
+config COOVACHILLI_OPENSSL
+       bool "OpenSSL"
+
+endchoice
+
+endmenu
diff --git a/net/coova-chilli/Makefile b/net/coova-chilli/Makefile
index 3b350cb..b5bd93c 100644
--- a/net/coova-chilli/Makefile
+++ b/net/coova-chilli/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2010 OpenWrt.org
+# Copyright (C) 2007-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,25 +8,42 @@
 include $(TOPDIR)/rules.mk

 PKG_NAME:=coova-chilli
-PKG_VERSION:=1.2.9
-PKG_RELEASE:=1
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=3

 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ap.coova.org/chilli
-PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
+PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a

-PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1

+
+PKG_CONFIG_DEPENDS := \
+  COOVACHILLI_MINIPORTAL \
+  COOVACHILLI_REDIR \
+  COOVACHILLI_USERAGENT \
+  COOVACHILLI_DNSLOG \
+  COOVACHILLI_UAMDOMAINFILE \
+  COOVACHILLI_NOSSL \
+  COOVACHILLI_MATRIXSSL \
+  COOVACHILLI_CYASSL \
+  COOVACHILLI_OPENSSL \
+  COOVACHILLI_BINSTATUSFILE \
+  COOVACHILLI_PROXY \
+  COOVACHILLI_MINICONFIG
+
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk

 define Package/coova-chilli
   SUBMENU:=Captive Portals
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-tun +librt
+  DEPENDS:=+kmod-tun +librt +COOVACHILLI_MATRIXSSL:libmatrixssl +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl
   TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
   URL:=http://www.coova.org/CoovaChilli
+  MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
+  MENU:=1
 endef

 define Package/coova-chilli/description
@@ -39,8 +56,59 @@ define Package/coova-chilli/description
        favorite radius server.
 endef

-define Package/coova-chilli/conffiles
-/etc/chilli.conf
+define Package/coova-chilli/config
+  source "$(SOURCE)/Config.in"
+endef
+
+define KernelPackage/coova
+  URL:=http://www.coova.org/CoovaChilli
+  SUBMENU:=Network Support
+  DEPENDS:=+coova-chilli
+  TITLE:=Coova kernel module
+  FILES:=$(PKG_BUILD_DIR)/src/linux/xt_coova.$(LINUX_KMOD_SUFFIX)
+  AUTOLOAD:=$(call AutoLoad,90,coova)
+endef
+
+define KernelPackage/coova/description
+Kernel module for CoovaChilli
+endef
+
+DISABLE_NLS=
+
+CONFIGURE_VARS += \
+       ac_cv_func_malloc_0_nonnull=yes \
+       ac_cv_func_realloc_0_nonnull=yes \
+       ac_cv_func_memcmp_working=yes \
+       ac_cv_func_setvbuf_reversed=no \
+       KERNEL_DIR="$(LINUX_DIR)"
+
+CONFIGURE_ARGS += \
+       $(if $(CONFIG_COOVACHILLI_REDIR),--enable,--disable)-chilliredir \
+       $(if $(CONFIG_COOVACHILLI_DNSLOG),--enable,--disable)-dnslog \
+       $(if $(CONFIG_COOVACHILLI_MINIPORTAL),--enable,--disable)-miniportal \
+       $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \
+       $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
+       $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
+       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyassl \
+       $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
+       $(if $(CONFIG_COOVACHILLI_BINSTATUSFILE),--enable,--disable)-binstatusfile \
+       $(if $(CONFIG_COOVACHILLI_PROXY),--enable,--disable)-chilliproxy \
+       $(if $(CONFIG_COOVACHILLI_MINICONFIG),--enable,--disable)-miniconfig \
+       $(if $(CONFIG_PACKAGE_kmod-coova),--with-nfcoova,)
+
+MAKE_FLAGS += \
+       KERNEL_DIR="$(LINUX_DIR)"
+
+MAKE_INSTALL_FLAGS += \
+       KERNEL_DIR="$(LINUX_DIR)" \
+       INSTALL_MOD_PATH="$(PKG_INSTALL_DIR)"
+
+define Build/Configure
+( \
+               cd $(PKG_BUILD_DIR); \
+               rm -rf config.{cache,status} ; \
+               $(call Build/Configure/Default) \
+)
 endef

 define Package/coova-chilli/install
@@ -52,6 +120,16 @@ define Package/coova-chilli/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(CP) files/chilli.init $(1)/etc/init.d/chilli
+       $(INSTALL_DIR) $(1)/lib/firewall
+       $(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
+       $(if $(CONFIG_PACKAGE_kmod-coova), \
+               $(INSTALL_DIR) $(1)/usr/lib/iptables; \
+               $(CP) $(PKG_BUILD_DIR)/src/linux/lib*.so $(1)/usr/lib/iptables/ \
+       )
 endef

 $(eval $(call BuildPackage,coova-chilli))
+$(eval $(call KernelPackage,coova))
+
diff --git a/net/coova-chilli/files/chilli.firewall b/net/coova-chilli/files/chilli.firewall
new file mode 100644
index 0000000..e3856c4
--- /dev/null
+++ b/net/coova-chilli/files/chilli.firewall
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+chilli_firewall() {
+    local cfg="$1"
+
+    local network ifname tun
+
+    config_get network "$cfg" network
+
+    . /lib/functions/network.sh
+    network_get_device ifname ${network:-lan}
+
+    if [ "$ifname" = "" ]
+    then
+       config_get ifname "$cfg" dhcpif
+    fi
+
+    config_get tun "$cfg" tundev
+
+    for n in ACCEPT DROP REJECT
+    do
+       iptables -F zone_${network}_${n}
+       iptables -I zone_${network}_${n} -i $tun -j $n
+       iptables -I zone_${network}_${n} -o $tun -j $n
+    done
+
+    iptables -D forward -i ${ifname} -j zone_${network}_forward
+    iptables -A forward -i ${ifname} -j DROP
+    iptables -A forward -i $tun -j zone_${network}_forward
+
+    iptables -D input -i ${ifname} -j zone_${network}
+    iptables -A input -i $tun -j zone_${network}
+
+    iptables -I zone_${network} -p tcp --dport 3990 -j ACCEPT
+    iptables -I zone_${network} -p tcp --dport 3991 -j ACCEPT
+}
+
+chilli_post_core_cb() {
+    config_load chilli
+    config_foreach chilli_firewall chilli
+}
diff --git a/net/coova-chilli/files/chilli.init b/net/coova-chilli/files/chilli.init
new file mode 100644
index 0000000..a72f4f4
--- /dev/null
+++ b/net/coova-chilli/files/chilli.init
@@ -0,0 +1,61 @@
+#!/bin/sh /etc/rc.common
+
+START=30
+STOP=90
+
+config_cb() {
+    chilli_inst=$2
+    if [ "$chilli_inst" != "" ]
+    then
+       rm -f /var/run/chilli_${chilli_inst}*
+       chilli_conf=/var/run/chilli_${chilli_inst}.conf
+       eval "start_chilli_$chilli_inst=1"
+    fi
+}
+
+option_cb() {
+    case "$1" in
+        # UCI settings
+       network)
+           . /lib/functions/network.sh
+           local ifname
+           network_get_device ifname $2
+           echo "dhcpif=\"$ifname\"" >> $chilli_conf
+           ;;
+       disabled)
+           eval "start_chilli_$chilli_inst=0"
+           ;;
+        # boolean settings
+       dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
+           [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
+           ;;
+       *)
+           echo "$1=\"$2\"" >> $chilli_conf
+           ;;
+    esac
+}
+
+start_chilli() {
+    local cfg="$1"
+    local start_chilli=$(eval "echo \$start_chilli_$cfg")
+    [ "$start_chilli" = "0" ] && return
+    local base=/var/run/chilli_${cfg}
+    chilli -c ${base}.conf \
+       --pidfile ${base}.pid \
+       --cmdsocket ${base}.sock \
+       --unixipc ${base}.ipc &
+}
+
+start() {
+    config_load chilli
+    config_foreach start_chilli chilli
+}
+
+stop() {
+    ls /var/run/chilli*.pid 2>/dev/null && {
+       kill $(cat /var/run/chilli*.pid)
+       sleep 1
+       killall -9 chilli
+       rm -f /var/run/chilli*
+    }
+}
diff --git a/net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch b/net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch
new file mode 100644
index 0000000..446eb63
--- /dev/null
+++ b/net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch
@@ -0,0 +1,24 @@
+--- a/src/system.h
++++ b/src/system.h
+@@ -76,10 +76,6 @@
+ #include <sys/stat.h>
+ #endif
+
+-#ifdef HAVE_SYS_SYSINFO_H
+-#include <sys/sysinfo.h>
+-#endif
+-
+ #ifdef HAVE_TIME_H
+ #include <time.h>
+ #endif
+@@ -132,6 +128,10 @@
+ #include <linux/un.h>
+ #endif
+
++#ifdef HAVE_SYS_SYSINFO_H
++#include <sys/sysinfo.h>
++#endif
++
+ #elif defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__)
+ #include <net/if.h>
+ #include <net/bpf.h>
diff --git a/net/coova-chilli/patches/200-fix_compile_kmod.patch b/net/coova-chilli/patches/200-fix_compile_kmod.patch
new file mode 100644
index 0000000..799d26e
--- /dev/null
+++ b/net/coova-chilli/patches/200-fix_compile_kmod.patch
@@ -0,0 +1,24 @@
+--- a/src/linux/Makefile
++++ b/src/linux/Makefile
+@@ -9,7 +9,6 @@ modules:
+       make -C ${KERNEL_DIR} M=$$PWD $@;
+
+ modules_install:
+-      make -C ${KERNEL_DIR} M=$$PWD $@;
+
+ modules_clean:
+       make -C ${KERNEL_DIR} M=$$PWD $@;
+@@ -24,9 +23,9 @@ lib%.o: lib%.c
+       $(CC) $(CFLAGS) -fPIC -O2 -Wall -I${KERNEL_DIR}/include -D_INIT=lib$*_init -c -o $@ $<;
+
+ install: modules_install libxt_coova.so
+-      mkdir -p $(DESTDIR)/lib/xtables/
+-      cp libxt_coova.so $(DESTDIR)/lib/xtables/
++      mkdir -p $(DESTDIR)/usr/lib/iptables/
++      cp libxt_coova.so $(DESTDIR)/usr/lib/iptables/
+
+ distdir:
+
+-distclean: clean
+\ No newline at end of file
++distclean: clean
--
1.8.2.1


;

public by teslamint  2586  1  4  0

install tcpdump on /tmp

install tcpdump on /tmp: install_tcpdump.sh
#!/bin/sh

# fix opkg package url
sed -i 's@12.09.1@12.09@g' /etc/opkg.conf

# install libpcap and tcpdump
/bin/opkg update
/bin/opkg install tcpdump --add-dest temp:/tmp -d temp

# link libpcap and tcpdump
ln -sf /tmp/usr/lib/libpcap* /usr/lib
ln -sf /tmp/usr/sbin/* /usr/sbin


;

public by teslamint  1984  0  3  0

TP-LINK Firmware flashing script by attila.lendvai from http://wiki.openwrt.org/toh/tp-link/tl-wr1043nd#oem.mass.flashing (rev. 1336694829) CC-BY-SA 3.0

TP-LINK Firmware flashing script by attila.lendvai from http://wiki.openwrt.org/toh/tp-link/tl-wr1043nd#oem.mass.flashing (rev. 1336694829) CC-BY-SA 3.0: tplink.sh
#!/bin/bash
 
# Pass the firmware image file to be flashed as the first and only
# command line argument.
#
# The second curl call will time out, but it is expected. Once the
# script exits, you can unplug the ethernet cable and proceed to the
# next router, but do KEEP each router ON POWER until the new image is
# fully written! When flashing is done the router reboots
# automatically (as shown by all the leds flashing once).
 
curl \
  --user admin:admin \
  --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0' \
  --referer 'http://192.168.1.1/userRpm/SoftwareUpgradeRpm.htm' \
  --form "Filename=@$1" -F 'Upgrade=Upgrade' \
  http://192.168.1.1/incoming/Firmware.htm > /dev/null
 
sleep 1
 
curl \
  --max-time 2 \
  --user admin:admin \
  --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0' \
  --referer 'http://192.168.1.1/incoming/Firmware.htm' \
  http://192.168.1.1/userRpm/FirmwareUpdateTemp.htm >  /dev/null

;

public by teslamint  234855  1  4  0

modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html

modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html: coova-1.3.0-custom.patch
Index: files/chilli.init
===================================================================
--- files/chilli.init   (리비전 0)
+++ files/chilli.init   (리비전 0)
@@ -0,0 +1,61 @@
+#!/bin/sh /etc/rc.common
+
+START=30
+STOP=90
+
+config_cb() {
+    chilli_inst=$2
+    if [ "$chilli_inst" != "" ]
+    then
+       rm -f /var/run/chilli_${chilli_inst}*
+       chilli_conf=/var/run/chilli_${chilli_inst}.conf
+       eval "start_chilli_$chilli_inst=1"
+    fi
+}
+
+option_cb() {
+    case "$1" in
+        # UCI settings
+       network)
+           . /lib/functions/network.sh
+           local ifname
+           network_get_device ifname $2
+           echo "dhcpif=\"$ifname\"" >> $chilli_conf
+           ;;
+       disabled)
+           eval "start_chilli_$chilli_inst=0"
+           ;;
+        # boolean settings
+       dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
+           [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
+           ;;
+       *)
+           echo "$1=\"$2\"" >> $chilli_conf
+           ;;
+    esac
+}
+
+start_chilli() {
+    local cfg="$1"
+    local start_chilli=$(eval "echo \$start_chilli_$cfg")
+    [ "$start_chilli" = "0" ] && return
+    local base=/var/run/chilli_${cfg}
+    chilli -c ${base}.conf \
+       --pidfile ${base}.pid \
+       --cmdsocket ${base}.sock \
+       --unixipc ${base}.ipc &
+}
+
+start() {
+    config_load chilli
+    config_foreach start_chilli chilli
+}
+
+stop() {
+    ls /var/run/chilli*.pid 2>/dev/null && {
+       kill $(cat /var/run/chilli*.pid)
+       sleep 1
+       killall -9 chilli &
+       rm -f /var/run/chilli*
+    }
+}
Index: files/chilli.firewall
===================================================================
--- files/chilli.firewall       (리비전 0)
+++ files/chilli.firewall       (리비전 0)
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+chilli_firewall() {
+    local cfg="$1"
+    local tun ipup addr mask net dhcpif uamport uamuiport
+
+    config_get tun "$cfg" tundev
+    config_get ipup "$cfg" ipup
+    config_get addr "$cfg" uamlisten
+    config_get net "$cfg" net
+    config_get dhcpif "$cfg" dhcpif
+    config_get uamport "$cfg" uamport
+    config_get uamuiport "$cfg" uamuiport
+
+    if [ -f /var/run/chilli.$tun.sh ]; then
+        [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
+        DEV=$tun
+        ADDR=$addr
+        MASK=255.255.255.0
+        NET=$net
+        DHCPIF=$dhcpif
+        UAMPORT=$uamport
+        UAMUIPORT=$uamuiport
+        . $ipup
+    fi
+
+}
+
+chilli_post_core_cb() {
+    config_load chilli
+    config_foreach chilli_firewall chilli
+}
+
Index: Makefile
===================================================================
--- Makefile    (리비전 37020)
+++ Makefile    (작업 사본)
@@ -8,16 +8,13 @@
 include $(TOPDIR)/rules.mk

 PKG_NAME:=coova-chilli
-PKG_VERSION:=1.2.9
+PKG_VERSION:=1.3.0
 PKG_RELEASE:=1

 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://ap.coova.org/chilli
-PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
+PKG_SOURCE_URL:=http://coova-chilli.s3.amazonaws.com/
+PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a

-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
 include $(INCLUDE_DIR)/package.mk

 define Package/coova-chilli
@@ -25,33 +22,102 @@
   SECTION:=net
   CATEGORY:=Network
   DEPENDS:=+kmod-tun +librt
-  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
-  URL:=http://www.coova.org/CoovaChilli
+  TITLE:=Wireless LAN HotSpot controller
+  URL:=http://www.coova.org/
 endef

+define Package/coova-chilli-miniportal
+  SUBMENU:=Captive Portals
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+coova-chilli
+  TITLE:=CoovaChilli MiniPortal
+  URL:=http://www.coova.org/
+endef
+
 define Package/coova-chilli/description
        CoovaChilli is an open source access controller for wireless LAN
        access points and is based on ChilliSpot. It is used for authenticating
        users of a wireless (or wired) LAN. It supports web based login (UAM)
-       which is today's standard for public HotSpots and it supports Wireless
-       Protected Access (WPA) which is the standard of the future.
-       Authentication, authorization and accounting (AAA) is handled by your
-       favorite radius server.
+       which is today's standard for public HotSpots and it supports Wireless Protected
+       Access (WPA) which is the standard of the future. Authentication,
+       authorization and accounting (AAA) is handled by your favorite
+       radius server.
 endef

-define Package/coova-chilli/conffiles
-/etc/chilli.conf
+define Build/Configure
+  (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
+               $(TARGET_CONFIGURE_OPTS) \
+                CFLAGS="$(strip $(TARGET_CFLAGS)) -DNEED_DN_SKIPNAME" \
+                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+               ac_cv_func_malloc_0_nonnull=yes \
+               ac_cv_func_realloc_0_nonnull=yes \
+               ac_cv_func_memcmp_working=yes \
+               ac_cv_func_setvbuf_reversed=no \
+                ./configure \
+                       --target=$(GNU_TARGET_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --build=$(GNU_HOST_NAME) \
+                       --program-prefix="" \
+                       --program-suffix="" \
+                       --prefix=/usr \
+                       --sysconfdir=/etc \
+                       --exec-prefix=/usr \
+                       --bindir=/usr/bin \
+                       --datadir=/usr/share \
+                       --includedir=/usr/include \
+                       --infodir=/usr/share/info \
+                       --libdir=/usr/lib \
+                       --libexecdir=/usr/lib \
+                       --localstatedir=/var \
+                       --mandir=/usr/share/man \
+                       --sbindir=/usr/sbin \
+                       --enable-shared \
+                       --disable-static \
+                       --with-gnu-ld \
+                       --enable-miniconfig \
+                       --enable-miniportal \
+                       --enable-chilliredir \
+                       --enable-chilliproxy \
+                       --enable-binstatusfile \
+        );
 endef

+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
+endef
+
+
+define Package/coova-chilli-miniportal/install
+       $(INSTALL_DIR) $(1)/etc/chilli
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/www $(1)/etc/chilli/
+endef
+
 define Package/coova-chilli/install
-       $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
-       $(INSTALL_DIR) $(1)/etc/chilli
-       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
+       $(INSTALL_DIR) $(1)/etc/chilli
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/up.sh $(1)/etc/chilli/
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/down.sh $(1)/etc/chilli/
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/wwwsh $(1)/etc/chilli/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(CP) files/chilli.init $(1)/etc/init.d/chilli
+       $(INSTALL_DIR) $(1)/lib/firewall
+       $(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
 endef

 $(eval $(call BuildPackage,coova-chilli))
+$(eval $(call BuildPackage,coova-chilli-miniportal))

;