⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prngd.rc

📁 随机数算法
💻 RC
字号:
#!/sbin/sh## prngd.rc: PRNGD start-up and shutdown script## Allowed exit values:#       0 = success; causes "OK" to show up in checklist.#       1 = failure; causes "FAIL" to show up in checklist.#       2 = skip; causes "N/A" to show up in the checklist.#           Use this value if execution of this script is overridden#           by the use of a control variable, or if this script is not#           appropriate to execute for some other reason.#       3 = reboot; causes the system to be rebooted after execution.# Input and output:#       stdin is redirected from /dev/null##       stdout and stderr are redirected to the /etc/rc.log file#       during checklist mode, or to the console in raw mode.umask 022PATH=/usr/sbin:/usr/bin:/sbinexport PATHWHAT='PRNGD (Pseudo Random Number Generator Daemon)'WHAT_PATH=/opt/local/bin/prngdWHAT_CONFIG=/etc/rc.config.d/prngdWHAT_LOG=/var/opt/prngd/prngd.logWHAT_SOCKETS=/var/opt/prngd/egd-pool# NOTE: If your script executes in run state 0 or state 1, then /usr might#       not be available.  Do not attempt to access commands or files in#       /usr unless your script executes in run state 2 or greater.  Other#       file systems typically not mounted until run state 2 include /var#       and /opt.rval=0# Check the exit value of a command run by this script.  If non-zero, the# exit code is echoed to the log file and the return value of this script# is set to indicate failure.set_return() {	x=$?	if [ $x -ne 0 ]; then		echo "EXIT CODE: $x"		rval=1	# script FAILed	fi}case $1 in'start_msg')	echo "Starting $WHAT"	;;'stop_msg')	echo "Stopping $WHAT"	;;'start')	if [ -f $WHAT_CONFIG ] ; then		. $WHAT_CONFIG	else		echo "ERROR: $WHAT_CONFIG defaults file MISSING"	fi		if [ "$PRNGD_START" -eq 1 -a -x $WHAT_PATH ]; then		PRNGD_SOCKETS=${PRNGD_SOCKETS:-$WHAT_SOCKETS}		PRNGD_LOG=${PRNGD_LOG:-$WHAT_LOG}		su prngd -c "$WHAT_PATH $PRNGD_ARGS $PRNGD_SOCKETS >$PRNGD_LOG 2>&1" &&			echo $WHAT started		set_return	else		rval=2	fi	;;'stop')	PRNGD_SOCKETS=${PRNGD_SOCKETS:-$WHAT_SOCKETS}	$WHAT_PATH --kill $PRNGD_SOCKETS	if [ $? -eq 0 ]; then		echo "$WHAT stopped"	else		rval=1		echo "Unable to stop $WHAT"	fi	;;*)	echo "usage: $0 {start|stop|start_msg|stop_msg}"	rval=1	;;esacexit $rval

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -