wok-6.x view openvpn/stuff/usr/bin/conf2opvn @ rev 23176
openvpn: add conf2opvn (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Mar 18 11:14:38 2020 +0100 (2020-03-18) |
parents | dd9b0bdf9963 |
children |
line source
1 #!/bin/sh
3 [ "$1" ] && echo "usage: $0 < file.conf > file.opvn" && 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, need check\n"; for (i in f) {
9 print "<" i ">"; system("cat " f[i]); print "</" i ">\n"
10 }
11 }'