]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
time.cgi: Use new perl system functions
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 14:00:54 +0000 (15:00 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 14:00:54 +0000 (15:00 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/time.cgi

index 8363b995123864129322b302844fd7e3beab6f51..09ef2aa84b3101e53000bf1b1ecd03f8376e134d 100644 (file)
@@ -125,8 +125,8 @@ ERROR:
 
        if ($timesettings{'ENABLENTP'} eq 'on' && $timesettings{'VALID'} eq 'yes')
        {
-               system ('/usr/bin/touch', "${General::swroot}/time/enable");
-               system ('/usr/local/bin/timectrl enable >/dev/null 2>&1');
+               &General::system('/usr/bin/touch', "${General::swroot}/time/enable");
+               &General::system('/usr/local/bin/timectrl', 'enable');
                &General::log($Lang::tr{'ntp syncro enabled'});
                unlink "/var/lock/time/counter";
                if ($timesettings{'UPDATE_METHOD'} eq 'periodically')
@@ -138,7 +138,7 @@ ERROR:
                }
                if ($timesettings{'ENABLECLNTP'} eq 'on') # DPC added to 1.3.1
                {
-                       system ('/usr/bin/touch', "${General::swroot}/time/allowclients"); # DPC added to 1.3.1
+                       &General::system('/usr/bin/touch', "${General::swroot}/time/allowclients"); # DPC added to 1.3.1
                        &General::log($Lang::tr{'ntpd restarted'}); # DPC added to 1.3.1
                } else {
                        unlink "${General::swroot}/time/allowclients";
@@ -150,11 +150,11 @@ ERROR:
                unlink "${General::swroot}/time/enable";
                unlink "/var/lock/time/settimenow";
                unlink "${General::swroot}/time/allowclients"; # DPC added to 1.3.1
-               system ('/usr/local/bin/timectrl disable >/dev/null 2>&1');
+               &General::system('/usr/local/bin/timectrl', 'disable');
                &General::log($Lang::tr{'ntp syncro disabled'})
        }
        if (! $errormessage) {
-               system ('/usr/local/bin/timectrl restart >/dev/null 2>&1'); # DPC added to 1.3.1
+               &General::system('/usr/local/bin/timectrl', 'restart'); # DPC added to 1.3.1
        }
 }
 
@@ -163,7 +163,7 @@ ERROR:
 $timesettings{'ACTION'} = &Header::cleanhtml ($timesettings{'ACTION'});
 if ($timesettings{'ACTION'} eq $Lang::tr{'set time now'} && $timesettings{'ENABLENTP'} eq 'on')
 {
-       system ('/usr/bin/touch', "/var/lock/time/settimenow");
+       &General::system('/usr/bin/touch', "/var/lock/time/settimenow");
 }
 
 &General::readhash("${General::swroot}/time/settings", \%timesettings);