#!/bin/sh

#pragma ident "@(#)skip_conf.sh	1.4 99/07/22"


CATGETS=/usr/lib/skip/catgets
set_num=19	#  SI_admin
LS()		# localize a string
{
	msg_num=$1; shift
	if [ -x ${CATGETS} ]
	then ${CATGETS} $set_num $msg_num "$*"
	else echo "$*"
	fi
}

if [ $# -lt 1 ]
then
  	# N.B. The LS's have to be on seperate lines or else ./genmsg
  	# won't find the second one.
	echo `LS 300 "usage: "` $0 \
	 `LS 301 " variable [value(s)]"` 1>&2
	exit 1
fi

SUNOS=`/bin/uname -r | /bin/sed 's/\..*//g'`
if [ $SUNOS = 5 ]; then
	SKIP_BIN=/usr/sbin
	SKIP_ETC=/etc/skip/
else
	SKIP_BIN=/usr/skip/bin
	SKIP_ETC=/etc/skip
fi

VARIABLE=$1
shift

/bin/grep -v "^$VARIABLE" $SKIP_ETC/skipd.conf > /tmp/skipd.conf$$

if [ $# -gt 0 ]
then
	for i in $*
	do
		echo "$VARIABLE $i" >> /tmp/skipd.conf$$
	done
fi

cp /tmp/skipd.conf$$ $SKIP_ETC/skipd.conf
rm /tmp/skipd.conf$$
