#!/bin/sh
#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# SME Server software. Instead, modify the source template in
# an /etc/e-smith/templates-custom directory. For more
# information, see http://www.e-smith.org/custom/
#
# copyright (C) 1999-2003 Mitel Networks Corporation
#------------------------------------------------------------


#
# diald   The on demand TCP/IP networking program
#              
#
# chkconfig: 2345 57 5
# description: Diald is the smart demand-dial PPP/SLIP networking daemon. \
#      It selectively activates the SLIP/PPP link to the Internet when \
#      traffic is detected that is considered important.
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/diald ] || exit 0

[ -f /etc/diald.conf ] || exit 0


# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting diald: "
        echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 2 > /proc/sys/net/ipv4/ip_dynaddr
#       echo 7 > /proc/sys/net/ipv4/ip_dynaddr
	daemon /usr/sbin/diald 
	echo
	touch /var/lock/subsys/diald
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down diald: "
	killproc /usr/sbin/diald
	echo
	rm -f /var/lock/subsys/diald
	;;
  restart)
        $0 stop
	$0 start
	;;
  status)
	status diald
	;;
  *)
	echo "Usage: diald {start|stop|restart|status}"
	exit 1
esac

exit 0
