Last active
July 25, 2018 16:53
-
-
Save leotm/377efbde1e7037bbebfa to your computer and use it in GitHub Desktop.
Node.js - Add authentication to OpenVPN (.ovpn) files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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