scripts in if-up.d not executed when ppp connection is created
7,162
For example put this script in /etc/ppp/ip-up.d/
to make default route to ppp0
interface every time when go up, make script called script with execute permissions 755
sudo nano /etc/ppp/ip-up.d/script
# Check for specific interface if desired
[ "$PPP_IFACE" != "ppp0" ] || exit 0
# Do something
sudo route add default dev ppp0
chmod 755 /etc/ppp/if-up.d/script
Try
Related videos on Youtube
![Kumar](https://i.stack.imgur.com/IPJHP.jpg?s=256&g=1)
Author by
Kumar
Updated on September 18, 2022Comments
-
Kumar almost 2 years
I have a simple script "test" in
/etc/network/if-up.d
directory. The script contains below commands. It creates a empty text file, whenever an interfaces changes state from down to up.#!/bin/bash sudo touch /home/duser/test1.txt
But the script is not executing when ppp connection is established. The ppp connection belongs to an usb-modem. The pppd daemon will be initiated by wvdial. I tried disconnecting and connecting my wlan, then the script is executing. But it doesn't work for ppp. Note: The script have 755 permission
-
muru about 9 yearsUse
/etc/ppp/ip-up.d
instead, if the script is specifically forppp
. -
RikiRiocma over 6 yearssometimes it needs to have a prefix like '0000script' otherwise it does not works.
-
-
Redanium over 8 yearsI did the edit :)
-
FarK almost 5 yearsI am pretty sure there is no need for sudo inside script