#!/bin/bash
#                                                                                       #
# DATE:   12-Dec-2018                                                                   #
# REV:    1.0                                                                           #
# DEVELOPED BY: Parablu Systems                                                         #
# DEVELOPER: VAIBHAV K                                                                  #
# PLATFORM: Ubuntu

PARABLU_CONFIG_SCRIPT_PATH=../config/parablu_config.sh
PARABLU_COMPONENT_SCRIPT_PATH=../config/parablu_component_config.sh
source $PARABLU_CONFIG_SCRIPT_PATH
source $PARABLU_COMPONENT_SCRIPT_PATH

if [ "$SERVER_TYPE" == "0" ] || [ "$SERVER_TYPE" == "3" ]; then
        sudo apt-get -y update
        sudo apt-get -y install ntp
        sudo ufw allow 123/udp
else

        sudo apt-get -y update
        sudo apt-get -y install ntp
        sed -i "/ubuntu.pool.ntp.org/d" /etc/ntp.conf
        sed -i "19iserver $DB_IP iburst" /etc/ntp.conf
	sudo service ntp restart
fi
