wok-6.x view openvpn/stuff/usr/bin/conf2ovpn @ rev 23216

openvpn: add make-ovpn
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 22 20:02:34 2020 +0100 (2020-03-22)
parents
children
line source
1 #!/bin/sh
3 [ "$1" ] && echo "usage: $0 < file.conf > file.ovpn" && exit 1
4 awk '{ if ($1 == "ca" || $1 == "cert" || $1 == "key" || $1 == "extra-certs" ||
5 $1 == "secret" || $1 == "pkcs12" || $1 == "http-proxy-user-pass" ||
6 $1 == "crl-verify" || $1 == "tls-auth" || $1 == "tls-crypt" ||
7 $1 == "dh") f[$1]=$2; else print
8 } END { print "key-direction 1 # for tls-auth, please check\n"; for (i in f) {
9 print "<" i ">"; system("cat " f[i]); print "</" i ">\n"
10 }
11 }'