I have set a ppp interface but as it is a bit unstable, I want to keep checking its status in a cron script and if down, take certain action.
I found this stackoverflow question (although in C++) helpful and it works for normal interfaces but for type ppp, it always shows that the interface is up. "ip addr ls" shows the interface status as UNKNOWN irrespective of whether the modem is switched on or not. I do not know if that is the issue though the ppp interface works fine despite the UNKNOWN status.
What do I need to add to the program to get real up/down status of the ppp interface?