#!/bin/bash
#
# Hilfe - Text:
# ---------------------------------------------------------------
# This script is called with the following arguments:
# Arg Name Example
# $1 Interface name ppp0
# $2 The tty ttyS1
# $3 The link speed 38400
# $4 Local IP number 12.34.56.78
# $5 Peer IP number 12.34.56.99
# $6 Optional "ipparam" value foo
# ---------------------------------------------------------------

# don't bother to restart postfix when lo is configured.
if [ "$1" = "lo" ]; then
exit 0
fi

# add route
if [ "$6" = "hamnet" ]; then
route add -net 44.0.0.0/8 $1
fi

# add forwarding
if [ "$6" = "hamnet" ]; then
sysctl -w net.ipv4.ip_forward=1
fi

# add masquerading
if [ "$6" = "hamnet" ]; then
iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
fi

exit 0
#end
