summaryrefslogtreecommitdiff
blob: dcdc4fa6fca68c1002c0c344bdc9941b7805bb29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From fdd5944ab29f51188634874097d674c643e9e141 Mon Sep 17 00:00:00 2001
From: Alexys Jacob <ultrabug@gentoo.org>
Date: Wed, 17 May 2017 18:05:59 +0200
Subject: [PATCH 6/9] ntp setup: add support for gentoo linux

Signed-off-by: Alexys Jacob <ultrabug@gentoo.org>
---
 dist/common/scripts/scylla_ntp_setup | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dist/common/scripts/scylla_ntp_setup b/dist/common/scripts/scylla_ntp_setup
index 75598229..1587e195 100755
--- a/dist/common/scripts/scylla_ntp_setup
+++ b/dist/common/scripts/scylla_ntp_setup
@@ -35,6 +35,16 @@ if is_debian_variant; then
     fi
     ntpdate `cat /etc/ntp.conf |egrep "^server"|head -n1|awk '{print $2}'`
     service ntp start
+elif is_gentoo_variant; then
+    emerge -uq net-misc/ntp
+    pidof ntpd &>/dev/null || ntpdate `cat /etc/ntp.conf |grep "^server"|head -n1|awk '{print $2}'`
+    if is_systemd; then
+        systemctl enable sntpd.service
+        systemctl start sntpd.service
+    else
+        rc-update add ntpd default
+        service ntpd start
+    fi
 else
     yum install -y ntp ntpdate || true
     if [ "$DOMAIN" != "" ]; then
-- 
2.12.2