#!/bin/sh
#
# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved
#
# @(#)editor_logger.sh	1.3 00/01/07 Sun Microsystems, Inc.
#

PATH="/opt/SUNWicg/SunScreen/bin:/usr/bin:/usr/sbin"
export PATH

SS_ETCDIR=/etc/opt/SUNWicg/SunScreen
SS_LIBDIR=/opt/SUNWicg/SunScreen/lib
read SCREENNAME <$SS_ETCDIR/name

domain=default
prog=edit

while getopts aD:U:P:R: c
do case $c in
  a) prog=activate;;
  D) domain=$OPTARG;;
  U) user=$OPTARG;;
  P) policy=$OPTARG;;
  R) registry=$OPTARG;;
  *) exit 1;;
  esac
done

[ -z "$registry" ] ||
    $SS_LIBDIR/logmsg -A $prog -F NOTICE -P $prog "reason:utf8=\"saved $SCREENNAME $domain $registry\"; user:utf8=\"$user\""
[ -z "$policy" ] ||
    $SS_LIBDIR/logmsg -A $prog -F NOTICE -P $prog "reason:utf8=\"saved $SCREENNAME $domain $policy\"; user:utf8=\"$user\""
