aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2019-07-21 23:16:21 -0700
committerGitHub <noreply@github.com>2019-07-21 23:16:21 -0700
commit615ff1f3e0fdd95e2ea6c76ce124016db78e8625 (patch)
tree8fd8be48dfdcf3642f481011a5d7527b9c216957 /net
parentded736a697a8227325c6d42188644b98585a6c76 (diff)
parent2accfd1e7ac7c763eb524fa3c74b29208005bdec (diff)
Merge pull request #9517 from neheb/apf
apfree-wifidog: Run init script through shellcheck
Diffstat (limited to 'net')
-rw-r--r--net/apfree-wifidog/Makefile13
-rw-r--r--net/apfree-wifidog/files/wifidogx.init32
-rw-r--r--net/apfree-wifidog/patches/010-openssl-deprecated.patch18
3 files changed, 40 insertions, 23 deletions
diff --git a/net/apfree-wifidog/Makefile b/net/apfree-wifidog/Makefile
index f1435d773..bea59df31 100644
--- a/net/apfree-wifidog/Makefile
+++ b/net/apfree-wifidog/Makefile
@@ -9,18 +9,17 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=apfree-wifidog
PKG_VERSION:=3.11.1716
-PKG_RELEASE=1
-
-PKG_LICENSE:=GPL-3.0-or-later
-PKG_LICENSE_FILES:=COPYING
-
-PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/liudf0716/apfree_wifidog.git
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_MIRROR_HASH:=76eda57e40b919091281305344bc57fc732a779d7944f57bd5de87914ba127d1
+PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>
+PKG_LICENSE:=GPL-3.0-or-later
+PKG_LICENSE_FILES:=COPYING
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@@ -29,7 +28,7 @@ define Package/apfree-wifidog
SECTION:=net
CATEGORY:=Network
DEPENDS:=+zlib +iptables-mod-extra +iptables-mod-ipopt +kmod-ipt-nat +iptables-mod-nat-extra \
- +libjson-c +ipset +libip4tc +libevent2 +libevent2-openssl +libuci +px5g
+ +libjson-c +ipset +libip4tc +libevent2 +libevent2-openssl +libuci +px5g
TITLE:=Apfree's wireless captive portal solution
URL:=https://github.com/liudf0716/apfree_wifidog
endef
diff --git a/net/apfree-wifidog/files/wifidogx.init b/net/apfree-wifidog/files/wifidogx.init
index 4dbbcf6bf..be87af5b9 100644
--- a/net/apfree-wifidog/files/wifidogx.init
+++ b/net/apfree-wifidog/files/wifidogx.init
@@ -50,7 +50,7 @@ prepare_mqtt_conf() {
config_get serveraddr "$cfg" "serveraddr"
config_get serverport "$cfg" "serverport"
- [ -z "${serveraddr}" -o -z "${serverport}" ] && return 1
+ [ -z "${serveraddr}" ] || [ -z "${serverport}" ] && return 1
cat <<-EOF >>${CONFIGFILE}
MQTT {
@@ -97,10 +97,10 @@ prepare_wifidog_conf() {
[ -f ${CONFIGFILE} ] && rm -f ${CONFIGFILE}
config_get enable "${cfg}" "disabled" 0
- [ "${enable}" = "0" ] || {
+ if [ "${enable}" = "0" ]; then
echo "wifidogx disabled in /etc/config/wifidogx file, please set disabled to 0 to enable it" >&2
return
- }
+ fi
default_gateway_id=$(sed -e 's/://g' /sys/class/net/br-lan/address)
@@ -185,7 +185,7 @@ prepare_wifidog_conf() {
GatewayID $gateway_id
GatewayInterface $gateway_interface
Externalinterface $external_interface
-
+
AuthServer {
Hostname $auth_server_hostname
HTTPPort $auth_server_port
@@ -196,7 +196,7 @@ prepare_wifidog_conf() {
$set_auth_server_path_ping
$set_auth_server_path_auth
}
-
+
$set_delta_traffic
CheckInterval $check_interval
ClientTimeout $client_timeout
@@ -216,21 +216,21 @@ prepare_wifidog_conf() {
FirewallRuleSet global {
$set_firewall_rule_global
}
-
+
FirewallRuleSet validating-users {
$set_firewall_rule_validating_users
FirewallRule allow to 0.0.0.0/0
}
-
+
FirewallRuleSet known-users {
$set_firewall_rule_known_users
FirewallRule allow to 0.0.0.0/0
}
-
+
FirewallRuleSet auth-is-down {
$set_firewall_rule_auth_is_down
}
-
+
FirewallRuleSet unknown-users {
$set_firewall_rule_unknown_users
FirewallRule allow udp port 53
@@ -238,7 +238,7 @@ prepare_wifidog_conf() {
FirewallRule allow udp port 67
FirewallRule allow tcp port 67
}
-
+
FirewallRuleSet locked-users {
$set_firewall_rule_locked_users
FirewallRule block to 0.0.0.0/0
@@ -250,19 +250,19 @@ init_config() {
config_load wifidogx
config_foreach prepare_wifidog_conf wifidog
- [ ! -f ${CONFIGFILE} ] && {
+ if [ ! -f ${CONFIGFILE} ]; then
echo "no wifidogx.conf, exit..." >&2
exit
- }
+ fi
- [ -s "${APFREE_CERT}" -a -s "${APFREE_KEY}" ] || {
+ if [ -s "${APFREE_CERT}" ] && [ -s "${APFREE_KEY}" ]; then
generate_keys
- }
+ fi
- [ -s ${APFREE_KEY} -a -s ${APFREE_CERT} ] || {
+ if [ -s ${APFREE_KEY} ] && [ -s ${APFREE_CERT} ]; then
echo "no cert or key, exit..." >&2
exit
- }
+ fi
config_foreach prepare_mqtt_conf mqtt
diff --git a/net/apfree-wifidog/patches/010-openssl-deprecated.patch b/net/apfree-wifidog/patches/010-openssl-deprecated.patch
new file mode 100644
index 000000000..ece9ce348
--- /dev/null
+++ b/net/apfree-wifidog/patches/010-openssl-deprecated.patch
@@ -0,0 +1,18 @@
+--- a/src/gateway.c
++++ b/src/gateway.c
+@@ -78,10 +78,14 @@ openssl_init(void)
+ ERR_load_crypto_strings();
+ SSL_load_error_strings();
+ OpenSSL_add_all_algorithms();
+-#endif
+ debug (LOG_DEBUG, "Using OpenSSL version \"%s\"\nand libevent version \"%s\"\n",
+ SSLeay_version (SSLEAY_VERSION),
+ event_get_version ());
++#else
++ debug (LOG_DEBUG, "Using OpenSSL version \"%s\"\nand libevent version \"%s\"\n",
++ OpenSSL_version (OPENSSL_VERSION),
++ event_get_version ());
++#endif
+ }
+
+ static void