Skip to content

Instantly share code, notes, and snippets.

@leotm
Last active July 25, 2018 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leotm/377efbde1e7037bbebfa to your computer and use it in GitHub Desktop.
Save leotm/377efbde1e7037bbebfa to your computer and use it in GitHub Desktop.
Node.js - Add authentication to OpenVPN (.ovpn) files
var fs = require("fs");
var glob = require("glob");
glob('*.ovpn', function (err, files) {
if (err) { throw err; }
files.forEach(function(item,index,array){
// Each .ovpn file will use login.conf containing un and pw
fs.appendFile(item, ' auth-user-pass login.conf', function (err) {});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment