prepare_wifidog_conf() {
local cfg=$1
- local enable
+ local disabled
local gateway_id
local gateway_interface
local auth_server_hostname
[ -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
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