Saturday, 2 November 2019

Reset my VPN using a script?

const exec = require('child_process').exec;function getIP() { exec('curl ifconfig.me', (error, stdout, stderr) => { console.log(IP: ${stdout}); // console.log(getIP Error); })};function resetIP() { exec('sudo service openvpn reset', (error, stdout, stderr) => { console.log(VPN reset); // console.log(resetIP Error); })};getIP();setTimeout(function() { resetIP() }, 5000);setTimeout(function() { getIP() }, 20000);this returns the same IP address. I'm thinking the second IP request is getting through during the reset somehow but I have no idea.

Submitted November 02, 2019 at 06:42AM by thedawgbeard

No comments:

Post a Comment