#!/bin/sh
#******************************************************************
#ident /etc/init.d/plip Time-stamp: <97/08/15 10:23:01 bav>
#******************************************************************
#                           Gerd Bavendiek  bav@rw.sni.de  97-05-00
#
# This script is used to start/stop the plip-Interface. This is done
# depending on the current setting of the variable PLIP_START, which
# is expected to be defined in the file /tmp/netenv. See the
# README.netenv for further information.
#-------------------------------------------------------------------

PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin

set -e

if [ -r /tmp/netenv ]; then
   . /tmp/netenv
fi

case "$1" in
  start)
	 if [ "$PLIP_START" = "yes" ]; then	
	    if /sbin/lsmod | grep '^lp' ; then
	       /sbin/rmmod lp
	    fi
	    echo "Starting plip-interface plip1 ..."
	    ifconfig plip1 $PLIP_IPADDR pointopoint $PLIP_PARTNER up    
	    route add $PLIP_PARTNER && echo "done"      
	 fi	
	 ;;
   stop)
	 ifconfig plip1 down
	 /sbin/rmmod plip 
	 ;;
  *)
     echo "Usage: /etc/init.d/plip {start|stop}"
     exit 1
     ;;
esac

exit 0
