source: branches/8.09/package/ppp/files/etc/ppp/ip-up @ 17763

Last change on this file since 17763 was 17763, checked in by nico, 7 years ago

[package] ppp: quote positional parameters when calling up/down scripts (closes: #5622)

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 681 bytes
Line 
1#!/bin/sh
2. /etc/functions.sh
3PPP_IFACE="$1"
4PPP_TTY="$2"
5PPP_SPEED="$3"
6PPP_LOCAL="$4"
7PPP_REMOTE="$5"
8PPP_IPPARAM="$6"
9PPP_UNIT="${PPP_IFACE##ppp}"
10
11export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
12[ -z "$PPP_IPPARAM" -o -z "$PPP_LOCAL" ] || {
13        uci_set_state network "$PPP_IPPARAM" unit "$PPP_UNIT"
14        uci_set_state network "$PPP_IPPARAM" ipaddr "$PPP_LOCAL"
15        uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
16}
17[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM" DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
18
19[ -d /etc/ppp/ip-up.d ] && {
20        for SCRIPT in /etc/ppp/ip-up.d/*
21        do
22                [ -x "$SCRIPT" ] && "$SCRIPT" "$@"
23        done
24}
Note: See TracBrowser for help on using the repository browser.