Check ppp status

Hello everyone. Sometimes I faces with a problem:
PPP interface has a status connected - R. But in fact, it’s not. To fix it, I have to off/on an interface. After that - everything is right.
How can I check the status of connection and repair it with a script?

You could lower the keep alive timeout value…