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
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-03-03 12:41:21 +0300
committerGitHub <noreply@github.com>2020-03-03 12:41:21 +0300
commit1a9b4e4cc398bd0804cbf10afa71f293efd863e2 (patch)
treec545846ccc5f8376f22d53bf2e0cfce9b15986ad /lib
parent7cc8fafb034182908cbe19c904233ea24b713063 (diff)
parent8b3e7a3c1b343272b0dad624b8145ceb5169b8e6 (diff)
Merge pull request #176 from nextcloud/bugfix/error-handling-shell
Do not print errors if time server config is not available
Diffstat (limited to 'lib')
-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 a315a93..3581eae 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;
}