#!/bin/sh # # Startup/shutdown individual privileged users' boottime/shutdown tasks. # # 20000528 cmjg # CONFFILE=/etc/userstart.conf HOMEPATH=/home USERDIR=.rc.d PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin export PATH rval=0 case $1 in start_msg) echo "Starting priviledged user scripts" ;; stop_msg) echo "Stopping priviledged user scripts" ;; 'start') if [ -f $CONFFILE ] then echo "Starting priviledged user scripts" USERS=`/bin/cat $CONFFILE` for i in $USERS do dir=$HOMEPATH/$i/$USERDIR if [ -d $dir ] then echo Starting user "$i" for script in ${dir}/S*; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 /usr/bin/su - $i -c "${script} start") fi done fi done fi ;; 'stop') if [ -f $CONFFILE ] then echo "Stopping priviledged user scripts" USERS=`/bin/cat $CONFFILE` for i in $USERS do dir=$HOMEPATH/$i/$USERDIR if [ -d $dir ] then echo Stopping user "$i" for script in ${dir}/K*; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 /usr/bin/su - $i -c "${script} stop") fi done fi done fi ;; *) echo "usage: $0 {start|stop}" rval=1 ;; esac exit $rval