Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2020-03-03 13:11:54 +0300
committerGitHub <noreply@github.com>2020-03-03 13:11:54 +0300
commite2a8085635fe6708d5b379dafa93940e46656c37 (patch)
tree9a152236e4482ba7c2280fbe63e9855fd75a7fbb
parentc359fc9fea754cf0b041c2dc6b0aee9fbd9d2a0d (diff)
parent5ac5dbc236a1c9c5553247883193d03f838a84ca (diff)
Merge pull request #178 from nextcloud/backport/176/stable18
[stable18] Do not print errors if time server config is not available
-rw-r--r--lib/OperatingSystems/DefaultOs.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/OperatingSystems/DefaultOs.php b/lib/OperatingSystems/DefaultOs.php
index d695c34..bebbfd2 100644
--- a/lib/OperatingSystems/DefaultOs.php
+++ b/lib/OperatingSystems/DefaultOs.php
@@ -92,8 +92,8 @@ class DefaultOs {
* @return string
*/
public function getTimeServers() {
- $servers = shell_exec('cat /etc/ntp.conf |grep \'^pool\' | cut -f 2 -d " "');
- $servers .= ' ' . shell_exec('cat /etc/systemd/timesyncd.conf |grep \'^NTP=\' | cut -f 2 -d " "');
+ $servers = shell_exec('cat /etc/ntp.conf 2>/dev/null |grep \'^pool\' | cut -f 2 -d " "');
+ $servers .= ' ' . shell_exec('cat /etc/systemd/timesyncd.conf 2>/dev/null |grep \'^NTP=\' | cut -f 2 -d " "');
return $servers;
}