LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2019, 03:40 AM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 6, SH4, Debian
Posts: 137

Rep: Reputation: Disabled
Unknown syntax in NTP startup script


Below beginning of startup script of /etc/init.d/ntp file:

Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:        ntp
# Required-Start:  $network $remote_fs $syslog
# Required-Stop:   $network $remote_fs $syslog
# Default-Start:   2 3 4 5
# Default-Stop:    1
# Short-Description: Start NTP daemon
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /lib/lsb/init-functions

DAEMON=/usr/sbin/ntpd
PIDFILE=/var/run/ntpd.pid

test -x $DAEMON || exit 5

if [ -r /etc/default/ntp ]; then
        . /etc/default/ntp
fi

if [ /var/lib/ntp/ntp.conf.dhcp -nt /etc/ntp.conf ]; then
        NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp"
fi
Be so kind to answer me because I googled a lot but did not found answer.

What mean "dot" in line:

Code:
. /lib/lsb/init-functions
And "-nt" in "if" statement" ?

Code:
if [ /var/lib/ntp/ntp.conf.dhcp -nt /etc/ntp.conf ]
 
Old 02-11-2019, 03:56 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,009

Rep: Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687
dot is the short name of the command source in some shells, but actually source does not exist in sh (but .)
see man page:
Code:
. file
            The commands in the specified file are read and executed by the shell.
see man test, -nt means file is newer
 
1 members found this post helpful.
  


Reply

Tags
init, linux, ntp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ntp server keeps on changing time-local ntp server Gil@LQ Linux - Newbie 3 01-23-2013 10:33 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM
NTP's ntp.conf pxumsgdxpcvjm Linux - Server 2 08-30-2007 10:34 PM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 03:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration