Cronjob for restarting a dead VPN connection

Questions and mods regarding system management may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Cronjob for restarting a dead VPN connection

Postby erak » Mon Jan 28, 2013 3:56 am

Hi,

I have a problem that my VPN client connection dies intermittently. It doesn't disconnect though, just stops working.

My idea is a cronjob which checks the connection (a ping for example) every few minutes, and restarts the VPN connection if it's down.

Is this possible, any ideas?
Synology DS213+ | DSM 4.1 | 1x WD20EFRX
erak
I'm New!
I'm New!
 
Posts: 3
Joined: Mon Jun 25, 2012 7:20 pm

Re: Cronjob for restarting a dead VPN connection

Postby erak » Tue Jan 29, 2013 4:37 am

Ok, so I was searching for the correct command for starting the VPN client service. But it turns out, if I just issue "killall pppd", it restarts itself.

I thought the command was "pppd call <profile> updetach", with the saved profile in /etc/ppp/peers/
But it generated the following error:
Couldn't open the /dev/ppp device: No such device or address
Please load the ppp_generic kernel module.

But it works if I'm already connected... No reason to divulge in this error though.

It feels unnecessary to add an extra ping when the DDNS service already is running. Is there a way to read the status from ddnsd? When the VPN is down, the status in the Control Panel read: "<Cannot detect external address>".
Synology DS213+ | DSM 4.1 | 1x WD20EFRX
erak
I'm New!
I'm New!
 
Posts: 3
Joined: Mon Jun 25, 2012 7:20 pm

Re: Cronjob for restarting a dead VPN connection

Postby erak » Tue Jan 29, 2013 2:43 pm

Update:

I found the file /tmp/externalIP.result

Now I just have to wait until the VPN connection fails and see what it reports.
Synology DS213+ | DSM 4.1 | 1x WD20EFRX
erak
I'm New!
I'm New!
 
Posts: 3
Joined: Mon Jun 25, 2012 7:20 pm


Return to System Managment Mods

Who is online

Users browsing this forum: No registered users and 4 guests