#!/bin/sh
#
# ip-up script for noip2

# Some useful variables, as noted at
# http://www.tldp.org/HOWTO/PPP-HOWTO/x1455.html
#
#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the tty device name
#       $3      the tty device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd

# Check if noip2 is installed
if [ ! -x /usr/bin/noip2 ]; then
    exit 0
fi

# Check, if this script is activated
if [ -f /etc/default/noip2 ]; then
    . /etc/default/noip2
    if [ $RUN_IPUP = "no" ]; then
        exit 0
    fi
else
    # Configuration defaults file not installed
    exit 0
fi

# Run noip2 with the supplied ppp interface
/usr/bin/noip2 -I $1
