summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc17
-rw-r--r--etc/inc/service-utils.inc9
2 files changed, 12 insertions, 14 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 75ccf12..9045ae5 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -742,9 +742,8 @@ function kill_wpasupplicant($interface) {
}
function find_dhclient_process($interface) {
- if(filter_translate_type_to_real_interface($interface) <> "")
- $realinterface = filter_translate_type_to_real_interface($interface);
- $pid = exec("/bin/pgrep -f \"dhclient (.*){$realinterface}\"");
+ $interface = convert_friendly_interface_to_real_interface_name($interface);
+ $pid = exec("/bin/ps awwux | /usr/bin/grep dhclient | /usr/bin/grep -v grep | /usr/bin/grep {$interface}");
return $pid;
}
@@ -965,7 +964,7 @@ EOD;
mwexec("/sbin/ifconfig {$optif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
return 0;
}
@@ -1004,10 +1003,10 @@ EOD;
mwexec("/sbin/ifconfig {$optif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif} ");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif} ");
$fout = fopen("/tmp/ifconfig_{$optif}","w");
- fwrite($fout, "/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
+ fwrite($fout, "/sbin/dhclient -cf {$g['varetc_path']}/dhclient_{$optif}.conf -sf /sbin/dhclient-script {$optif}");
fclose($fout);
return 0;
@@ -1044,10 +1043,10 @@ EOD;
mwexec("/sbin/ifconfig {$wanif} up");
/* fire up dhclient */
- mwexec("/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
+ mwexec("/sbin/dhclient -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
$fout = fopen("/tmp/ifconfig_{$wanif}","w");
- fwrite($fout, "/sbin/dhclient -nw -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
+ fwrite($fout, "/sbin/dhclient -cf {$g['varetc_path']}/dhclient_wan.conf -sf /sbin/dhclient-script {$wanif}");
fclose($fout);
return 0;
@@ -1583,4 +1582,4 @@ function get_interface_mac($interface) {
return $mac;
}
-?>
+?> \ No newline at end of file
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index d869819..01d2714 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -143,12 +143,11 @@ function is_process_running($process) {
}
function is_dhcp_running($interface) {
- if(filter_translate_type_to_real_interface($interface) <> "")
- $interface = filter_translate_type_to_real_interface($interface);
+ $interface = convert_friendly_interface_to_real_interface_name($interface);
$status = find_dhclient_process($interface);
if($status <> "")
- return 1;
- return 0;
+ return true;
+ return false;
}
function restart_service_if_running($service) {
@@ -182,4 +181,4 @@ function is_service_running($service, $ps = "") {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud