Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 28697691c864e24b01ff53272f982dc6 > scriptlet

zebra-0.93a-4mdk.ppc.rpm

PREUN

/bin/sh
if [ "$1" = "0" ]; then
    /sbin/chkconfig --del zebra
    /sbin/chkconfig --del ripd
    /sbin/chkconfig --del ripngd
    /sbin/chkconfig --del ospfd
    /sbin/chkconfig --del ospf6d
    /sbin/chkconfig --del bgpd
fi

POSTIN

/bin/sh
# zebra_spec_add_service <sercice name> <port/proto> <comment>
# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"

zebra_spec_add_service ()
{
  # Add port /etc/services entry if it isn't already there 
  if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
    echo "$1		$2			# $3"  >> /etc/services
  fi
}

zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
zebra_spec_add_service zebra    2601/tcp "zebra vty"
zebra_spec_add_service ripd     2602/tcp "RIPd vty"
zebra_spec_add_service ripngd   2603/tcp "RIPngd vty"
zebra_spec_add_service ospfd    2604/tcp "OSPFd vty"
zebra_spec_add_service bgpd     2605/tcp "BGPd vty"
zebra_spec_add_service ospf6d   2606/tcp "OSPF6d vty"

if [[ -f /usr/share/info/zebra.info.bz2 ]];then /sbin/install-info /usr/share/info/zebra.info.bz2 --dir=/usr/share/info/dir;fi 

/sbin/chkconfig --add zebra 
/sbin/chkconfig --add ripd
/sbin/chkconfig --add ripngd
/sbin/chkconfig --add ospfd
/sbin/chkconfig --add ospf6d
/sbin/chkconfig --add bgpd

# Create dummy files if they don't exist so basic functions can be used.
if [ ! -e /etc/zebra/zebra.conf ]; then
	echo "hostname `hostname`" > /etc/zebra/zebra.conf
	chmod 640 /etc/zebra/zebra.conf
fi
if [ ! -e /etc/zebra/vtysh.conf ]; then
	touch /etc/zebra/vtysh.conf
	chmod 640 /etc/zebra/vtysh.conf
fi

POSTUN

/bin/sh
if [ "$1" -ge  "1" ]; then
    /etc/rc.d/init.d/zebra  condrestart >/dev/null 2>&1
    /etc/rc.d/init.d/ripd   condrestart >/dev/null 2>&1
    /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
    /etc/rc.d/init.d/ospfd  condrestart >/dev/null 2>&1
    /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
    /etc/rc.d/init.d/bgpd   condrestart >/dev/null 2>&1
fi
if [ "$1" = "0" ]; then if [[ -f /usr/share/info/zebra.info.bz2 ]];then /sbin/install-info /usr/share/info/zebra.info.bz2 --dir=/usr/share/info/dir --remove ;fi; fi