FreeNAS Code
This project has moved to github - see https://github.com/freenas
Brought to you by:
cochard,
mattolander
#!/bin/sh # Copyright (c) 2007 Volker Theile (votdev@gmx.de) # All rights reserved. # PROVIDE: msntp # REQUIRE: DAEMON # XQUERY: -i "count(//system/ntp/enable) > 0" -o "0" -b # RCVAR: msntp . /etc/rc.subr . /etc/configxml.subr name="msntp" rcvar=`set_rcvar` # Custom commands start_precmd="start_precmd" stop_postcmd="stop_postcmd" # Defaults msntp_enable="${msntp_enable:=NO}" pidfile="/var/run/${name}.pid" command="/usr/local/bin/${name}" command_args="-r -P no -l ${pidfile} -x" start_precmd() { local _cmdarg # Get additional command arguments from config file. _cmdarg=`/usr/local/bin/xml sel -t \ -v "concat(//system/ntp/updateinterval,' ',//system/ntp/timeservers)" \ ${configxml_file} | /usr/local/bin/xml unesc` # Add additional arguments and set '&' to run in background. command_args="${command_args} ${_cmdarg} &" } stop_postcmd() { # Remove 'pidfile' because this is not done automatically. rm -f ${pidfile} } load_rc_config ${name} run_rc_command "$1"