Skip to content

Commit

Permalink
apfree-wifidog: fix bug of cert generating condition and enable misuse
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Aug 3, 2020
1 parent 7c9a091 commit 69a7cf4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/apfree-wifidog/files/wifidogx.init
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ prepare_mqtt_conf() {

prepare_wifidog_conf() {
local cfg=$1
local enable
local disabled
local gateway_id
local gateway_interface
local auth_server_hostname
Expand Down Expand Up @@ -96,8 +96,8 @@ prepare_wifidog_conf() {

[ -f ${CONFIGFILE} ] && rm -f ${CONFIGFILE}

config_get enable "${cfg}" "disabled" 0
if [ "${enable}" = "0" ]; then
config_get disabled "${cfg}" "disabled" 1
if [ "${disabled}" = "1" ]; then
echo "wifidogx disabled in /etc/config/wifidogx file, please set disabled to 0 to enable it" >&2
return
fi
Expand Down Expand Up @@ -255,11 +255,11 @@ init_config() {
exit
fi

if [ -s "${APFREE_CERT}" ] && [ -s "${APFREE_KEY}" ]; then
if [ ! -s "${APFREE_CERT}" ] || [ ! -s "${APFREE_KEY}" ]; then
generate_keys
fi

if [ -s ${APFREE_KEY} ] && [ -s ${APFREE_CERT} ]; then
if [ ! -s ${APFREE_KEY} ] || [ ! -s ${APFREE_CERT} ]; then
echo "no cert or key, exit..." >&2
exit
fi
Expand Down

0 comments on commit 69a7cf4

Please sign in to comment.