return 0;
}
- strcpy(temp, "0"); findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp);
- if (configtype < 1 || configtype > 4) configtype = 0;
+ strcpy(temp, "1"); findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp);
+ if (configtype < 1 || configtype > 4) configtype = 1;
if (HAS_GREEN)
{
static int choice = 0;
struct keyvalue *kv = initkeyvalues();
char message[1000];
- char temp[STRING_SIZE];
+ char temp[STRING_SIZE] = "1";
int x;
int result;
char networkrestart[STRING_SIZE] = "";
strcpy(temp, ""); findkey(kv, "CONFIG_TYPE", temp);
x = atol(temp);
x--;
- if (x < 1 || x > 4) x = 1;
+ if (x < 0 || x > 4) x = 0;
/* Format heading bit. */
snprintf(message, 1000, ctr[TR_CURRENT_CONFIG], configtypenames[x],
networkrestart);
int configtypemenu(void)
{
struct keyvalue *kv = initkeyvalues();
- char temp[STRING_SIZE] = "0";
+ char temp[STRING_SIZE] = "1";
char message[1000];
int choise, found;
- int rc;
-
- fprintf(flog,"Enter ConfigMenu\n");
+ int rc, configtype;
if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")))
{
choise++;
sprintf(temp, "%d", choise);
replacekeyvalue(kv, "CONFIG_TYPE", temp);
- clear_card_entry(_RED_CARD_);
- clear_card_entry(_ORANGE_CARD_);
- clear_card_entry(_BLUE_CARD_);
+ configtype = atol(temp);
+ if (!HAS_RED)
+ clear_card_entry(_RED_CARD_);
+ if (!HAS_ORANGE)
+ clear_card_entry(_ORANGE_CARD_);
+ if (!HAS_BLUE)
+ clear_card_entry(_BLUE_CARD_);
writekeyvalues(kv, CONFIG_ROOT "/ethernet/settings");
netaddresschange = 1;
return 0;
}
-
-
/* Driver menu. Choose drivers.. */
int drivermenu(void)
{
struct keyvalue *kv = initkeyvalues();
char message[STRING_SIZE];
- char temp[STRING_SIZE];
+ char temp[STRING_SIZE] = "1";
int configtype;
- int i, rc, kcount = 0, neednics; //i = 0, count = 0,
+ int i, rc, kcount = 0, neednics;
if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")))
{
return 0;
}
- strcpy(temp, "0"); findkey(kv, "CONFIG_TYPE", temp);
+ findkey(kv, "CONFIG_TYPE", temp);
configtype = atol(temp);
strcpy(message, ctr[TR_CONFIGURE_NETWORK_DRIVERS]);
- kcount = 0; // counter to find knowing nics.
- neednics = 0; // counter to use needing nics.
+ kcount = 0;
+ neednics = 0;
if (HAS_GREEN) {
sprintf(temp, "GREEN: %s\n", knics[_GREEN_CARD_].description);
strcat(message, temp);
neednics++;
}
- for ( i=0 ; i<4;i++) if (strcmp(knics[i].macaddr, "")) kcount++;
+ for ( i=0 ; i<4; i++)
+ if (strcmp(knics[i].macaddr, ""))
+ kcount++;
if (neednics = kcount)
{
ctr[TR_CANCEL], message);
if (rc == 0 || rc == 1)
{
- /* Shit, got to do something.. */
changedrivers();
}
} else {
- /* Shit, got to do something.. */
changedrivers();
}
freekeyvalues(kv);
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
return 0;
}
- runcommandwithstatus("/etc/rc.d/init.d/network stop red blue orange",
- ctr[TR_PUSHING_NON_LOCAL_NETWORK_DOWN]);
+ if (automode == 0)
+ runcommandwithstatus("/etc/rc.d/init.d/network stop red blue orange",
+ ctr[TR_PUSHING_NON_LOCAL_NETWORK_DOWN]);
findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp);
if (configtype == 1)