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 V3: * Remove include kernel.mk V2: * Fix forget install binary file * Clean up the init file format, use killall -s 9 instead of kill * Fix the PKG_BUILD_DIR not define net/njit8021xclient/Makefile | 47 +++++++++++++++++++++++++++++++++++ net/njit8021xclient/files/njit.conf | 10 ++++++++ net/njit8021xclient/files/njit.init | 28 +++++++++++++++++++++ 3 files changed, 85 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..1110a6c --- /dev/null +++ b/net/njit8021xclient/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) feixiang<feixi...@openwrt.org.cn> +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +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 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +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)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/client $(1)/usr/bin/njit-client + $(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..ba03fcc --- /dev/null +++ b/net/njit8021xclient/files/njit.init @@ -0,0 +1,28 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 feixiang <feixi...@openwrt.org.cn> + +START=82 + +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() { + killall -s 9 njit-client +} -- 1.7.9.5 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel