#!/bin/sh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/bin/cdat/types/psrasremove/unconfig.sh 1.3 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

#
# Script that runs on the client.
#

#
# Unconfigure syslog.
#

# File /etc/syslog.conf is a "privfiles" and must be edited with pvi
TERM=vt100 /usr/bin/pvi -c '
" delete all lines containing centralizedlog
g/centralizedlog/d
" write file and exit from the pvi editor
wq!' /etc/syslog.conf < /dev/null > /dev/null

# Restart the syslog daemon if it is running
if [ -f /etc/syslog.pid ]; then
    /usr/bin/refresh -s syslogd
fi

#
# Unconfigure errlog.
#
/usr/bin/odmchange -o SWservAt -q"attribute=errlg_pscale_enabled" << EOF
SWservAt:
	value=no
EOF

# Restart the errlog daemon if it is running
/usr/bin/ps wax | grep -v grep | grep -wq errdemon
[ $? -eq 0 ] && {
    /usr/lib/errstop
    /usr/lib/errdemon
}

#
# Disestablish the binding with the CA server.
#
/usr/bin/psbind remove CentralizedLogService
[ $? -ne 0 ] && exit 1

exit 0
