#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/circuits.net.ipv4 - net circuits (IPv4 specific) # # Last Update: $Id$ #---------------------------------------------------------------------------- # $1 = circuit information file # $2 = variable receiving an error message (if any) net_circuit_add_ipv4() { [ -n "$circ_net_address_ipv4" ] || return 1 circuit_write_field $circ_id circ_net_address_ipv4 "$circ_net_address_ipv4" circuit_write_field $circ_id circ_net_address_ipv4_resolved "" } # $1 = circuit identifier # $2 = circuit device # $3 = IPv4 address to add net_circuit_add_address_ipv4() { local id=$1 dev=$2 addr=$3 ip -4 addr add $addr dev $dev /etc/ppp/addr-up $dev $id "$addr" & } # $1 = circuit identifier # $2 = circuit device # $3 = IPv4 address to remove net_circuit_remove_address_ipv4() { local id=$1 dev=$2 addr=$3 ip -4 addr del $addr dev $dev /etc/ppp/addr-down $dev $id "$addr" & }