mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 02:42:58 +02:00
libsmooth+install: Fix output redirection
This commit is contained in:
@@ -209,13 +209,13 @@ int handledhcp(void)
|
||||
replacekeyvalue(dhcpkv, "ENABLE_GREEN", "on");
|
||||
fclose(fopen(CONFIG_ROOT "/dhcp/enable_green", "w"));
|
||||
chown(CONFIG_ROOT "/dhcp/enable_green", 99, 99);
|
||||
mysystem("/usr/local/bin/dhcpctrl enable");
|
||||
mysystem(NULL, "/usr/local/bin/dhcpctrl enable");
|
||||
}
|
||||
else
|
||||
{
|
||||
replacekeyvalue(dhcpkv, "ENABLE_GREEN", "off");
|
||||
unlink(CONFIG_ROOT "/dhcp/enable_green");
|
||||
mysystem("/usr/local/bin/dhcpctrl disable");
|
||||
mysystem(NULL, "/usr/local/bin/dhcpctrl disable");
|
||||
}
|
||||
replacekeyvalue(dhcpkv, "VALID", "yes");
|
||||
writekeyvalues(dhcpkv, CONFIG_ROOT "/dhcp/settings");
|
||||
@@ -248,7 +248,7 @@ int handledhcp(void)
|
||||
fclose(file);
|
||||
chown(CONFIG_ROOT "/dhcp/dhcpd.conf", 99, 99);
|
||||
if (automode == 0)
|
||||
mysystem("/usr/local/bin/dhcpctrl enable");
|
||||
mysystem(NULL, "/usr/local/bin/dhcpctrl enable");
|
||||
}
|
||||
result = 1;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ int handlekeymap(void)
|
||||
replacekeyvalue(kv, "KEYMAP", keymap);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
sprintf(commandstring, "/bin/loadkeys %s", keymap);
|
||||
mysystem(commandstring);
|
||||
mysystem(NULL, commandstring);
|
||||
result = 1;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -131,7 +131,7 @@ int writehostsfiles(void)
|
||||
fclose(file);
|
||||
|
||||
sprintf(commandstring, "/bin/hostname %s.%s", hostname, domainname);
|
||||
if (mysystem(commandstring))
|
||||
if (mysystem(NULL, commandstring))
|
||||
{
|
||||
errorbox(_("Unable to set hostname."));
|
||||
return 0;
|
||||
@@ -144,7 +144,7 @@ int handleisdn(void)
|
||||
{
|
||||
char command[STRING_SIZE];
|
||||
sprintf(command, "/etc/rc.d/init.d/mISDN config");
|
||||
if (runcommandwithstatus(command, _("ISDN"), _("Scanning and configuring ISDN devices.")))
|
||||
if (runcommandwithstatus(command, _("ISDN"), _("Scanning and configuring ISDN devices."), NULL))
|
||||
errorbox(_("Unable to scan for ISDN devices."));
|
||||
// Need to write some lines that count the cards and say the names...
|
||||
return 1;
|
||||
|
||||
@@ -422,7 +422,7 @@ int is_interface_up(char *card) { /* Check if the interface is UP */
|
||||
char temp[STRING_SIZE];
|
||||
|
||||
sprintf(temp,"ip link show dev %s | grep -q UP", card);
|
||||
if (mysystem(temp)) return 0; else return 1;
|
||||
if (mysystem(NULL, temp)) return 0; else return 1;
|
||||
}
|
||||
|
||||
int rename_device(char *old_name, char *new_name) {
|
||||
@@ -434,7 +434,7 @@ int rename_device(char *old_name, char *new_name) {
|
||||
return 0;
|
||||
}
|
||||
sprintf(temp,"/sbin/ip link set dev %s name %s",old_name ,new_name );
|
||||
mysystem(temp);
|
||||
mysystem(NULL, temp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -486,14 +486,14 @@ int nic_shutdown(char *nic) {
|
||||
char temp[STRING_SIZE];
|
||||
|
||||
sprintf(temp,"ip link set %s down", nic);
|
||||
mysystem(temp);
|
||||
mysystem(NULL, temp);
|
||||
}
|
||||
|
||||
int nic_startup(char *nic) {
|
||||
char temp[STRING_SIZE];
|
||||
|
||||
sprintf(temp,"ip link set %s up", nic);
|
||||
mysystem(temp);
|
||||
mysystem(NULL, temp);
|
||||
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ int scan_network_cards(void)
|
||||
|
||||
if (!(scanned_nics_read_done))
|
||||
{
|
||||
mysystem("/usr/bin/probenic.sh");
|
||||
mysystem(NULL, "/usr/bin/probenic.sh");
|
||||
if( (fp = fopen(SCANNED_NICS, "r")) == NULL )
|
||||
{
|
||||
fprintf(stderr,"Couldn't open "SCANNED_NICS);
|
||||
@@ -673,12 +673,12 @@ int nicmenu(int colour)
|
||||
_("Select"), _("Identify"), _("Cancel"), NULL);
|
||||
if ( rc == 2 ) {
|
||||
sprintf(temp, "/sbin/ip link set %s up", nics[found_NIC_as_Card[choise]].nic);
|
||||
mysystem(temp);
|
||||
mysystem(NULL, temp);
|
||||
sprintf(temp, "/usr/sbin/ethtool -p %s 10", nics[found_NIC_as_Card[choise]].nic);
|
||||
if (runcommandwithstatus(temp, _("Device Identification"), _("The lights on the selected port should flash now for 10 seconds...")) != 0) {
|
||||
if (runcommandwithstatus(temp, _("Device Identification"), _("The lights on the selected port should flash now for 10 seconds..."), NULL) != 0) {
|
||||
errorbox(_("Identification is not supported by this interface."));
|
||||
sprintf(temp, "/sbin/ip link set %s down", nics[found_NIC_as_Card[choise]].nic);
|
||||
mysystem(temp);
|
||||
mysystem(NULL, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -759,7 +759,7 @@ int manualdriver(char *driver, char *driveroptions)
|
||||
if (strlen(values[0]))
|
||||
{
|
||||
sprintf(commandstring, "/sbin/modprobe %s", values[0]);
|
||||
if (runcommandwithstatus(commandstring, _("Loading module..."), _("Loading module...")) == 0)
|
||||
if (runcommandwithstatus(commandstring, _("Loading module..."), _("Loading module..."), NULL) == 0)
|
||||
{
|
||||
if ((driverend = strchr(values[0], ' ')))
|
||||
{
|
||||
|
||||
@@ -107,12 +107,12 @@ int handlenetworking(void)
|
||||
if (netaddresschange)
|
||||
{
|
||||
runcommandwithstatus("/etc/rc.d/init.d/network stop",
|
||||
_("Networking"), _("Stopping network..."));
|
||||
_("Networking"), _("Stopping network..."), NULL);
|
||||
|
||||
rename_nics();
|
||||
|
||||
runcommandwithstatus("/etc/rc.d/init.d/network start",
|
||||
_("Networking"), _("Restarting network..."));
|
||||
_("Networking"), _("Restarting network..."), NULL);
|
||||
}
|
||||
} else {
|
||||
rename_nics();
|
||||
@@ -445,7 +445,7 @@ int changedrivers(void)
|
||||
}
|
||||
if (automode == 0)
|
||||
runcommandwithstatus("/etc/rc.d/init.d/network stop red blue orange",
|
||||
_("Networking"), _("Restarting non-local network..."));
|
||||
_("Networking"), _("Restarting non-local network..."), NULL);
|
||||
|
||||
findkey(kv, "CONFIG_TYPE", temp); configtype = atol(temp);
|
||||
if (configtype == 1)
|
||||
|
||||
@@ -35,7 +35,7 @@ int handlerootpassword(void)
|
||||
|
||||
snprintf(commandstring, STRING_SIZE,
|
||||
"/bin/echo 'root:%s' | /usr/sbin/chpasswd", password);
|
||||
if (runhiddencommandwithstatus(commandstring, _("Setting password"), _("Setting 'root' password...."))) {
|
||||
if (runhiddencommandwithstatus(commandstring, _("Setting password"), _("Setting 'root' password...."), NULL)) {
|
||||
errorbox(_("Problem setting 'root' password."));
|
||||
return 0;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ int handleadminpassword(void)
|
||||
snprintf(commandstring, STRING_SIZE,
|
||||
"/usr/sbin/htpasswd -c -m -b " CONFIG_ROOT "/auth/users admin '%s'", password);
|
||||
sprintf(message, _("Setting %s 'admin' user password..."), NAME);
|
||||
if (runhiddencommandwithstatus(commandstring, _("Setting password"), message)) {
|
||||
if (runhiddencommandwithstatus(commandstring, _("Setting password"), message, NULL)) {
|
||||
sprintf(message, _("Problem setting %s 'admin' user password."), NAME);
|
||||
errorbox(message);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user