#!/bin/sh

# Read the settings
source /app/bin/netsettings.sh

if [ "$NTP_ENABLED" != "" ]; then
    exec 1>/dev/ttyAMA0
    exec 2>/dev/ttyAMA0
    
    pgrep ntpd >/dev/null
    if [ $? -ne 0 ]; then
    	echo S10ntpd: Bringing up ntpd using $NTP_SERVER
    	ntpd -p $NTP_SERVER
    else
    	echo S10ntpd: ntpd already up
    fi
fi
