On 05/09/12 06:01, xian...@openmobilefree.net wrote:
> From: Xiangfu <xian...@openmobilefree.net>
>
> ---
>   This program widely used in China mainland universities for connect to 
> Internet.(more then 18 unvercities)
>   more info please checkout:
>     
> http://wiki.ubuntu.org.cn/%E5%8D%97%E4%BA%AC%E5%B7%A5%E7%A8%8B%E5%AD%A6%E9%99%A2802.1X%E5%AE%A2%E6%88%B7%E7%AB%AF
>     https://github.com/liuqun/njit8021xclient/
>
>   They(oepnwrt.org.cn) asked me help on sent this patch to upstream.
>
>   Xiangfu
>
>  net/njit8021xclient/Makefile        |   44 
> +++++++++++++++++++++++++++++++++++
>  net/njit8021xclient/files/njit.conf |   10 ++++++++
>  net/njit8021xclient/files/njit.init |   38 ++++++++++++++++++++++++++++++
>  3 files changed, 92 insertions(+)
>  create mode 100644 net/njit8021xclient/Makefile
>  create mode 100644 net/njit8021xclient/files/njit.conf
>  create mode 100755 net/njit8021xclient/files/njit.init
>
> diff --git a/net/njit8021xclient/Makefile b/net/njit8021xclient/Makefile
> new file mode 100644
> index 0000000..a6cbeb5
> --- /dev/null
> +++ b/net/njit8021xclient/Makefile
> @@ -0,0 +1,44 @@
> +# 
> +# Copyright (C) feixiang<feixi...@openwrt.org.cn>
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#

normall a (c) has a year
> +
> +include $(TOPDIR)/rules.mk
> +include $(INCLUDE_DIR)/kernel.mk
> +
why is kernel.mk included ?


> +PKG_NAME:=njit8021xclient
> +PKG_RELEASE:=1
> +PKG_VERSION:=1.2
> +PKG_SOURCE_URL:=https://github.com/downloads/liuqun/njit8021xclient/
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_MD5SUM:=e56f158d6a2b10c0b72edee5eba2da9c
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/njit8021xclient
> +  SECTION:=net
> +  CATEGORY:=Network
> +  TITLE:=NJIT 802.1X client program
> +  URL:=http://liuqun.github.com/njit8021xclient
> +  DEPENDS:=+libpcap +libopenssl +libpthread 
> +endef
> +
> +define Package/njit8021xclient/description
> + 802.1X client from Nanjing Institude of Technology,
> + compatable with H3C iNode 802.1X client.
> + Support H3C/iNode's private authentication protocol V2.40-V3.60
> +endef
> +
> +CONFIGURE_ARGS += \
> +     --program-prefix="njit-" \
> +     $(NULL)
> +
> +define Package/njit8021xclient/install
> +     $(INSTALL_DIR) $(1)/etc/init.d/
> +     $(INSTALL_BIN) files/njit.init $(1)/etc/init.d/njit
> +     $(INSTALL_DIR) $(1)/etc/config/
> +     $(INSTALL_CONF) files/njit.conf $(1)/etc/config/njit
> +endef
> +
> +$(eval $(call BuildPackage,njit8021xclient))
> diff --git a/net/njit8021xclient/files/njit.conf 
> b/net/njit8021xclient/files/njit.conf
> new file mode 100644
> index 0000000..2d1c2ad
> --- /dev/null
> +++ b/net/njit8021xclient/files/njit.conf
> @@ -0,0 +1,10 @@
> +
> +config njit
> +     option enabled '0'
> +
> +config user
> +     option enable '0'
> +     option username '111'
> +     option ifname 'eth0.2'
> +     option password 'xxx'
> +
> diff --git a/net/njit8021xclient/files/njit.init 
> b/net/njit8021xclient/files/njit.init
> new file mode 100755
> index 0000000..99eb094
> --- /dev/null
> +++ b/net/njit8021xclient/files/njit.init
> @@ -0,0 +1,38 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2012 OpenWrt.org.cn 
> +# Copyright (C) 2012 <feixiang>feixi...@openwrt.org.cn
> +
> +START=82
> +
> +logfile=/tmp/njit
> +
> +njit_config() {
> +
> +local username password ifname enable
> +
> +     config_get enable  "$1" 'enable' 0
> +     [ "$enable" == "0" ]&& return 0
> +     config_get username "$1" username
> +     config_get password "$1" password
> +     config_get ifname "$1" ifname
> +
> + njit-client $username $password $ifname&
> +
> +}
> +
> +start()
> +{
> +
> +enabled=$(uci get njit.@njit[0].enabled)
> +[ "$enabled" == 1 ]&&{
> +
> +             config_load njit
> +             config_foreach njit_config user
> +
> +}
> +}
> +stop()
> +{
> +kill njit-client
> +echo "stop"
> +}
the init script has no identatnion, missing whjitespaces and bogus blank
lines.


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to