mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
apfree-wifidog: fix bug of cert generating condition and enable misuse
Signed-off-by: Dengfeng Liu <dfliuc@isoftstone.com>
This commit is contained in:
@@ -62,7 +62,7 @@ prepare_mqtt_conf() {
|
|||||||
|
|
||||||
prepare_wifidog_conf() {
|
prepare_wifidog_conf() {
|
||||||
local cfg=$1
|
local cfg=$1
|
||||||
local enable
|
local disabled
|
||||||
local gateway_id
|
local gateway_id
|
||||||
local gateway_interface
|
local gateway_interface
|
||||||
local auth_server_hostname
|
local auth_server_hostname
|
||||||
@@ -96,8 +96,8 @@ prepare_wifidog_conf() {
|
|||||||
|
|
||||||
[ -f ${CONFIGFILE} ] && rm -f ${CONFIGFILE}
|
[ -f ${CONFIGFILE} ] && rm -f ${CONFIGFILE}
|
||||||
|
|
||||||
config_get enable "${cfg}" "disabled" 0
|
config_get disabled "${cfg}" "disabled" 1
|
||||||
if [ "${enable}" = "0" ]; then
|
if [ "${disabled}" = "1" ]; then
|
||||||
echo "wifidogx disabled in /etc/config/wifidogx file, please set disabled to 0 to enable it" >&2
|
echo "wifidogx disabled in /etc/config/wifidogx file, please set disabled to 0 to enable it" >&2
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -255,11 +255,11 @@ init_config() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s "${APFREE_CERT}" ] && [ -s "${APFREE_KEY}" ]; then
|
if [ ! -s "${APFREE_CERT}" ] || [ ! -s "${APFREE_KEY}" ]; then
|
||||||
generate_keys
|
generate_keys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s ${APFREE_KEY} ] && [ -s ${APFREE_CERT} ]; then
|
if [ ! -s ${APFREE_KEY} ] || [ ! -s ${APFREE_CERT} ]; then
|
||||||
echo "no cert or key, exit..." >&2
|
echo "no cert or key, exit..." >&2
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user