Browse Source

harmonized generated file names; added default up/down script

master
Robin Thoni 7 years ago
parent
commit
4f597e95e7

+ 1
- 2
vpngen.py View File

@@ -297,8 +297,7 @@ class VpnGen:
297 297
 
298 298
         files_paths = self.get_all_needed_files_paths(vpn_name, client_name)
299 299
         for file_path in files_paths:
300
-            split = os.path.splitext(file_path)
301
-            dest = "%s%s-%s%s" % (client_dir, os.path.basename(split[0]), vpn_name, split[1])
300
+            dest = "%s%s-%s-%s" % (client_dir, client_name, vpn_name, os.path.basename(file_path))
302 301
             shutil.copy(file_path, dest)
303 302
 
304 303
         split = os.path.splitext(client_conf_file)

+ 8
- 6
vpngen/default/clients/client.conf View File

@@ -6,13 +6,15 @@ remote ${hostname} ${port}
6 6
 resolv-retry infinite
7 7
 cipher AES-256-CBC
8 8
 lladdr ${mac}
9
-ifconfig-noexec
9
+#ifconfig-noexec
10
+up ${client}-${name}-up.sh
11
+down ${client}-${name}-down.sh
10 12
 
11 13
 # Keys
12
-ca ca-${name}.crt
13
-cert ${client}-${name}.crt
14
-key ${client}-${name}.key
15
-tls-auth ta-${name}.key 1
14
+ca ${client}-${name}-ca.crt
15
+cert ${client}-${name}-${client}.crt
16
+key ${client}-${name}-${client}.key
17
+tls-auth ${client}-${name}-ta.key 1
16 18
 key-direction 1
17 19
 
18 20
 # Security
@@ -21,4 +23,4 @@ persist-key
21 23
 persist-tun
22 24
 comp-lzo
23 25
 verb 3
24
-
26
+script-security 2

+ 1
- 0
vpngen/default/misc-files/down.sh View File

@@ -0,0 +1 @@
1
+#! /usr/bin/env sh

+ 1
- 0
vpngen/default/misc-files/up.sh View File

@@ -0,0 +1 @@
1
+#! /usr/bin/env sh

Loading…
Cancel
Save