]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
dhcp.cgi: Use new system methods
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 May 2021 18:37:07 +0000 (19:37 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 May 2021 18:37:07 +0000 (19:37 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/dhcp.cgi

index dd379dc47caa0f79fa159e7cb6870405e20e1d85..a2b56ffbb7c2eab11f4a383a5f19012274711e95 100644 (file)
@@ -1329,7 +1329,7 @@ sub buildconf {
                print FILE "}\n\n";
            }
 
-           system ('/usr/bin/touch', "${General::swroot}/dhcp/enable_${lc_itf}");
+           &General::system('/usr/bin/touch', "${General::swroot}/dhcp/enable_${lc_itf}");
            &General::log("DHCP on ${itf}: " . $Lang::tr{'dhcp server enabled'})
        } else {
            unlink "${General::swroot}/dhcp/enable_${lc_itf}";
@@ -1356,9 +1356,9 @@ sub buildconf {
     }
     print FILE "include \"${General::swroot}/dhcp/dhcpd.conf.local\";\n";
     close FILE;
-    if ( $dhcpsettings{"ENABLE_GREEN"} eq 'on' || $dhcpsettings{"ENABLE_BLUE"} eq 'on' ) {system '/usr/local/bin/dhcpctrl enable >/dev/null 2>&1';}
-    else {system '/usr/local/bin/dhcpctrl disable >/dev/null 2>&1';}
-    system '/usr/local/bin/dhcpctrl restart >/dev/null 2>&1 &';
+    if ( $dhcpsettings{"ENABLE_GREEN"} eq 'on' || $dhcpsettings{"ENABLE_BLUE"} eq 'on' ) {&General::system('/usr/local/bin/dhcpctrl', 'enable');}
+    else {&General::system('/usr/local/bin/dhcpctrl', 'disable');}
+    &General::system_background('/usr/local/bin/dhcpctrl', 'restart');
 }
 
 #