#!/sbin/sh
###############
# Product: PHKL_25609
# Fileset: PHKL_25609
# postremove
# @(#) postremove  $Revision: AUTO-GENERATED PATCH_11.00 (PHKL_25609)
#------------------------------------------------------------------#
# (c)Copyright 1983-2001 Hewlett-Packard Co., All Rights Reserved. #
#------------------------------------------------------------------#
# SD postremove script template for 11.X patches.                  #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to perform any necessary cleanup actions after the     #
# patch's files have been removed.                                 #
#------------------------------------------------------------------#

_PATCHID=PHKL_25609

UTILS="/usr/lbin/sw/control_utils"

if [ ! -f $UTILS ]; then
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

. $UTILS
exitval=$SUCCESS

#####
##### Insert any code you may require at this point in the script.
##### Pay attention to the exitval variable and set appropriately
##### in your code.  If you are unsure as to what types of operations
##### are legal in this file and what types aren't, consult the 
##### "Guidelines for SD Control Scripts" document.
#####
##### START_CUSTOMIZATION_HERE
#%# <static: PHKL_25026>
#%#
#%# <static: PHKL_24296>
#%#
# If there is no audio device, notify the user
ioscan -kf | grep -e audio -e Audio > /tmp/audio_ioscan$$.out 
if [[ ! -s /tmp/audio_ioscan$$.out ]];
then
    grep -e audio /stand/system > /tmp/audio_system$$.out
    if [[ -s /tmp/audio_system$$.out ]];
    then
        
	print "NOTE:    The system does not appear to have audio, but the audio driver is" 
	print "         still in the system file.  This means that the driver will remain"
	print "         in the kernel.  If you do not wish for the driver to be in the "
	print "         kernel, edit /stand/system and remove the \"audio\" line"
    fi # if [[ -s /tmp/audio_sytem.out ]]
    rm /tmp/audio_system$$.out
     
    if [[ -r /etc/rc.config.d/audio ]];
    then

         print "NOTE:    Disabling Aserver in /etc/rc.config.d/audio. "
	 print "         To make the Aserver start on boot-up, change "
	 print "         ASERVER to equal 1 in /etc/rc.config.d/audio "

	 # Set Aserver to 0 in /etc/rc.config.d/audio
	 grep -v "AUDIO_SERVER=" /etc/rc.config.d/audio > /tmp/audio.tmp
	 echo "AUDIO_SERVER=0"  >> /tmp/audio.tmp
	 mv /tmp/audio.tmp /etc/rc.config.d/audio
    fi
fi # if [[ -s audio_ioscan.out ]]

rm /tmp/audio_ioscan$$.out
#%#
#%# </static: PHKL_24296>

#%#
#%# </static: PHKL_25026>


#%# DO NOT REMOVE ANYTHING AFTER THIS LINE
#%# <PATCH CONTROL SCRIPT LOG>
#%# PHKL_25026
#%# </PATCH CONTROL SCRIPT LOG>
 
##### END_OF_CUSTOMIZATION
exit $exitval