Script to interact with vpn service


Recommended Posts

Hi guys,

 

New here and new to unraid, apologies if I'm in the wrong place but I'm hoping someone can help (or dissuade me).

 

I've got an unraid server deployed in a small (3-5 user) office that my wife and I use for our businesses, it acts mostly as a file server but has a couple of other bits on it for me to play with as I'm a software developer.

 

I set up a wireguard VPN to allow me to connect when I'm at home and still access everything, something I've noticed though is that when I'm on the VPN if I add a new peer to the wireguard tunnel, it disables it. I'm assuming this is a security feature of some sort (if it isn't please tell me where I need to go to raise a bug) but it would be really helpful for me to be able to mess around with that stuff remotely so I'm wondering if it would be possible to create a userscript that checks every x minutes and if the VPN tunnel is inactive, send a notification (I get them through Slack) and then restart the VPN tunnel? This would give me enough time to connect and make sure that everything is okay still but would also mean that I don't get locked out of the server until I physically visit the office and enable the tunnel manually.

 

If it's not possible it's not a huge issue, I'm just curious and as I'm a Windows user through and through I can't call upon existing knowledge to come up with a solution.

 

Thanks for any help!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.