Ticket #2987: ip-up

File ip-up, 647 bytes (added by igor.milavec@…, 10 years ago)
Line 
1#!/bin/sh
2PPP_IFACE="$1"
3PPP_TTY="$2"
4PPP_SPEED="$3"
5PPP_LOCAL="$4"
6PPP_REMOTE="$5"
7PPP_IPPARAM="$6"
8export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
9[ -z "$PPP_IPPARAM" -o -z "$PPP_LOCAL" ] || {
10        uci set "/var/state/network.$PPP_IPPARAM.ipaddr=$PPP_LOCAL"
11        uci set "/var/state/network.$PPP_IPPARAM.gateway=$PPP_REMOTE"
12}
13[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM" DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
14[ -d /etc/ppp/ip-up.d ] && {
15        for SCRIPT in /etc/ppp/ip-up.d/*
16        do
17                [ -x "$SCRIPT" ] && "$SCRIPT" $@
18        done
19}