#!/bin/sh
#
# Stops X.25 software before the X.25 drivers are removed.
#
if [ -f /etc/init.d/x25.control ]
then
    sh /etc/init.d/x25.control status > /tmp/status$$ 2>&1
    net_status=`grep 'up' /tmp/status$$`
    if [ "$net_status" != "" ]; then
        sh /etc/init.d/x25.control stop
    fi
    rm -f /tmp/status$$
fi
#
# As a result of licensing changes, no preremove script is now required.
# Just in case it comes back, the old script is saved as preremove_8.0
# and this remains as a dummy

if [ -h /opt/SUNWconn/x25/lib/libsockx25.a ]
then
  rm /opt/SUNWconn/x25/lib/libsockx25.a
  if [ -f /opt/SUNWconn/x25/lib/libsockx25.a.before4031664 ]
    then
      mv /opt/SUNWconn/x25/lib/libsockx25.a.before4031664 /opt/SUNWconn/x25/lib/libsockx25.a
  fi
fi
if [ -h /opt/SUNWconn/x25/lib/libsockx25.so.1 ]
then
  rm /opt/SUNWconn/x25/lib/libsockx25.so.1
  if [ -f /opt/SUNWconn/x25/lib/libsockx25.so.1.before4031664 ]
    then
      mv /opt/SUNWconn/x25/lib/libsockx25.so.1.before4031664 /opt/SUNWconn/x25/lib/libsockx25.so.1
  fi
fi
exit 0
