OpenWrt Forum Archive

Topic: pptpd server script not executed

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all & Happy New Year!

i'm upgrade firmware on my tplink tl-1043nd to openwrt 14.07
it's great but server scripts in /etc/ppp/ip-up.d/ not executed on client connect now
can anybody help me?

solved
1    #!/bin/sh
2    #. /etc/functions.sh - this line break script execution
3    PPP_IFACE="$1"
4    PPP_TTY="$2"
5    PPP_SPEED="$3"
6    PPP_LOCAL="$4"
7    PPP_REMOTE="$5"
8    PPP_IPPARAM="$6"
9    PPP_UNIT="${PPP_IFACE##ppp}"
10   
11    export 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    }

The discussion might have continued from here.