#!/bin/sh
#
# Copyright (c) 01/05/00 by Sun Microsystems, Inc. All rights reserved
#
# ident "@(#)preremove 1.2 93/01/27 Copyright 07 Jul 1995 SMI"
#
# preremove script for pkgadd
# Stops X.25 software before the X.25 drivers are removed.
#
# NPCTE fix for bug 4110533, SD, 07 Dec 99 - use of ${BASEDIR}
sh ${BASEDIR}/etc/init.d/snmpx25.control stop > ${BASEDIR}/tmp/status$$ 2>&1
sh ${BASEDIR}/etc/init.d/x25.control status > ${BASEDIR}/tmp/status$$ 2>&1
net_status=`grep 'up' ${BASEDIR}/tmp/status$$`
if [ "$net_status" != "" ]; then
	sh ${BASEDIR}/etc/init.d/x25.control stop
fi
rm -f ${BASEDIR}/tmp/status$$

# NPCTE fix for bug #4051921, SD, 27 May 97 
# need to get the minor # for the postremove script
cp ${BASEDIR}/etc/opt/SUNWconn/x25/hdlcmod.autopush ${BASEDIR}/var/tmp
# End NPCTE fix for bug 4110533

#
# safety precautions

sync
