📄 vsntp.redhat
字号:
#!/bin/sh# start and stop the SNTP client for Virtual PC# Red Hat styled comments for chkconfig# chkconfig: 2345 58 74# description: SNTP client for Virtual PC# processname: vsntp# config: /etc/sysconfig/vsntp# LSB-convension comments# See: http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html### BEGIN INIT INFO# Provides: vsntp# Required-Start: $network $time# Required-Stop: # Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: start and stop the SNTP client for Virtual PC# Description: vsntp is a SNTP client for Virtual PC that synchronize# time periodically for systems without hardward RTC.### END INIT INFOexport PATH=/sbin:/bin:/usr/sbin:/usr/bin# initialize the environmentTHISFILE="${0##*/}"VERSION="1.0.0"AUTHORNAME=imacatAUTHORMAIL=imacat@mail.imacat.idv.twlock=/var/lock/subsys/vsntp# Source function library.. /etc/init.d/functions# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.[ ${NETWORKING} = "no" ] && exit 0if [ -f /etc/sysconfig/vsntp ];then . /etc/sysconfig/vsntpficase "$SCHEDULER" inalarm|a|-a|--alarm) SCHEDULER=-a ;;*) SCHEDULER=-s ;;esac# default values -- do not change anything here_DEFSYNC_INTERVAL=900_DEFSCHEDULER=-sRETVAL="0"OPTIONS=""test -n "$SCHEDULER" -a "$SCHEDULER" != "$_DEFSCHEDULER" && OPTIONS="$OPTIONS $SCHEDULER"test -n "$SYNC_INTERVAL" -a "$SYNC_INTERVAL" != "$_DEFSYNC_INTERVAL" && OPTIONS="$OPTIONS -i $SYNC_INTERVAL"OPTIONS="$OPTIONS $SERVER"# See how we were called.start() { echo -n "Starting SNTP client for Virtual PC: " daemon vsntp $OPTIONS RETVAL="$?" echo [ "$RETVAL" -eq "0" ] && touch $lock return "$RETVAL"}stop() { echo -n "Stopping SNTP client for Virtual PC: " killproc vsntp RETVAL="$?" echo [ "$RETVAL" -eq "0" ] && rm -f $lock return "$RETVAL"}rhstatus() { status vsntp}restart() { stop start}# parse the argumentswhile [ "$#" != "0" ]; do case "$1" in start|stop|restart|status) action="$1" ;; -h|--help) cat << EOFStart and/or stop the SNTP client for Virtual PCUsage: $THISFILE {start|stop|restart|status} start Start the daemon. stop Stop the daemon. restart Stop and restart the daemon. status Display the daemon status -h,--help Display this help. -v,--version Display the version infomation.Report bugs to $AUTHORNAME <$AUTHORMAIL>EOF exit 0 ;; -v|--version) cat << EOF$THISFILE v$VERSION by $AUTHORNAME <$AUTHORMAIL>EOF exit 0 ;; *) echo "$THISFILE: unrecognized argument: $1" echo "Try \`$THISFILE --help' for more infomation" exit 1 ;; esac shiftdone# check the argumentsif [ -z "$action" ]; then cat << EOFUsage: $THISFILE {start|stop|restart|status}EOF exit 0fi# process nowcase "$action" instart) start ;;stop) stop ;;restart) restart ;;status) rhstatus ;;esacexit $?
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -