Menu="OtherSettings" Title="Date and Time" Icon="icon-clock" Tag="clock-o" --- $validIP4 = "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$"; $validIP6 = "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(:|([0-9a-fA-F]{1,4}:)+):(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)$"; $validMAC = "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$"; $tmzones = file("$docroot/webGui/include/timezones.key",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $system = "/sys/class/net"; $hwclock = $ports = $member = []; exec("ls --indicator-style=none $system|grep -P '^(bond|br|eth)[0-9]*$'",$net); foreach ($net as $port) { switch (preg_replace('/[0-9]+$/','',$port)) { case 'bond': if (!file_exists($system.'/'.str_replace('bond','br',$port))) $ports[] = $port; $member = array_merge($member,explode(' ',exec("cat $system/$port/bonding/slaves"))); break; case 'br': $member = array_merge($member,explode(' ',exec("ls --indicator-style=none $system/$port/brif"))); break; case 'eth': if (!in_array($port,$member)) $ports[] = $port; break; } } foreach ($ports as $port) $hwclock[$port] = exec("ethtool -T $port|grep -Pom1 '^PTP Hardware Clock: \K.+'")=='none' ? 'disabled' : ''; ?>