Checking of variables at the portal start

If the variables differ then it is necessary to set the correct variables.

Example of checking portal1 and portal2 variables. Example is for 0.2.14-r7.

// **********************************************************************
function check_portal_vars(){
    var arr = [
 '',
 ''
 ];
 //portal_1 portal_2 use_portal_dhcp portal_dhcp
    var real_arr = [
        {"value":getEnvironmentValue('portal1'),"variable":"portal1"},
        {"value":getEnvironmentValue('portal2'),"variable":"portal2"}
    ];
    for(var i = 0;i<4;i++){
        if(real_arr[i].value != arr[i]){
            if(arr[i] != 'no_matter'){
                setEnvironmentValue(real_arr[i].variable,arr[i]);
            }
        }       
    }
}
// **********************************************************************
// **********************************************************************
check_portal_vars();
// **********************************************************************

Example of index.html

// **********************************************************************
    PORTAL_1=`fw_printenv portal1 2>/dev/null`
    PORTAL_1=${PORTAL_1#portal1=}
 
if [ "$PORTAL_1" != "" ]
 
 
then
    fw_setenv portal1
    PORTAL_1=
fi
 
    PORTAL_2=`fw_printenv portal2 2>/dev/null`
    PORTAL_2=${PORTAL_2#portal2=}
 
if [ "$PORTAL_2" != "" ]
 
 
then
    fw_setenv portal2
    PORTAL_2=
fi
// **********************************************************************

Example of test.sh