Page 1 of 1
scripts ip-up
Posted: 14 May 2018, 00:55
by edsonag
Hello.
I've been searching and have not found.
How do I run a script (/etc/ppp/ip-up) in pppd-compact ip-up configuration?
thanks
Re: scripts ip-up
Posted: 14 May 2018, 05:52
by dimka88
Hi, in accel-ppp.conf uncomment
and
Code: Select all
[pppd-compat]
verbose=1
#ip-pre-up=/etc/ppp/ip-pre-up
ip-up=/etc/ppp/ip-up
ip-down=/etc/ppp/ip-down
#ip-change=/etc/ppp/ip-change
radattr-prefix=/var/run/radattr
#fork-limit=16
then create file and give permissions to execute
Code: Select all
mkdir -p /etc/ppp/
touch /etc/ppp/ip-up
chmod +x /etc/ppp/ip-up
in /etc/ppp/ip-up script you write some command, for example
Code: Select all
#!/bin/sh
echo "test" > /tmp/test_ppppd-compat
Re: scripts ip-up
Posted: 14 May 2018, 16:21
by edsonag
I did this and it's working. Thanks.
Needed other help. I need to pass some qos functions to the connection, through a script. But I can not.
Initially I'm just trying to implement the ip-up file, but it looks like it did not work.
Here is the code:
Code: Select all
#!/bin/sh
if [ -f /var/run/radattr.$1 ];
then
DOWNSPEED='awk '/Mikrotik-Rate/ {print $2}' radattr.$1 | tr -d 'k' | awk -F "/" '{print $1}'';
/sbin/tc qdisc del dev $1 root
/sbin/tc qdisc del dev $1 ingress
/sbin/tc qdisc add dev $1 root handle 1:0 htb
/sbin/tc class add dev $1 parent 1:0 classid 1:1 htb rate ${DOWNSPEED}mbit
fi
I found an ip-up file in another post and changed it as needed, but it is not working. I needed the script to take the pppoe connection and from there make the modifications.
Thanks.
Re: scripts ip-up
Posted: 14 May 2018, 17:48
by nik247
If you want only shaper from "Mikrotik-Rate-Limit":
Code: Select all
[shaper]
vendor=Mikrotik
attr=Mikrotik-Rate-Limit
rate-multiplier=0.001
Re: scripts ip-up
Posted: 17 May 2018, 15:51
by edsonag
Hi,
Yes. The shaper works correctly.
I need to make some changes to this shaper, through script.
scripts ip up
Posted: 30 Jul 2018, 15:11
by SashkaKP
How do I save all these scripts?
I have so many now, im scared ill lose them all