#!/bin/sh # Script to control prngd start/stop # Written by Tom G. Christensen DESC="prngd" PRNGD_BIN=/usr/tgcware/sbin/prngd POOLDIR=/var/run POOLFILE=egd-pool mode=$1 set `/usr/xpg4/bin/id -u` if [ $1 = "0" ]; then check_pooldir() { if [ ! -d $POOLDIR ]; then mkdir -p $POOLDIR chmod 755 $POOLDIR chown root.sys $POOLDIR fi } case $mode in 'start' ) if test -x $PRNGD_BIN; then echo "Starting $DESC" check_pooldir $PRNGD_BIN $POOLDIR/$POOLFILE fi ;; 'stop' ) echo "Stopping $DESC" $PRNGD_BIN -k $POOLDIR/$POOLFILE >/dev/null 2>&1 ;; 'restart') $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" esac else echo "$0: this script must be run as root... fatal error" fi