|
@@ -135,6 +135,17 @@ class VpnGen:
|
135
|
135
|
with open(self.get_client_variables_path(vpn_name, client_name), "r") as f:
|
136
|
136
|
return json.load(f)['variables']
|
137
|
137
|
|
|
138
|
+ def get_client_list(self, vpn_name):
|
|
139
|
+ base_dir = self.get_base_dir(vpn_name)
|
|
140
|
+ files_paths = glob.glob("%sclients%s*" % (base_dir, os.sep))
|
|
141
|
+ files_names = list(map(lambda file_path: os.path.basename(file_path), files_paths))
|
|
142
|
+
|
|
143
|
+ clients = []
|
|
144
|
+ for file_name in files_names:
|
|
145
|
+ if file_name != 'client.conf' and not file_name.endswith(".tar.bz2"):
|
|
146
|
+ clients.append(file_name[0:len(file_name) - len(vpn_name) - 1])
|
|
147
|
+ return clients
|
|
148
|
+
|
138
|
149
|
def setup_vars(self, vpn_name, variables):
|
139
|
150
|
easyrsadir = self.get_easy_rsa_dir(vpn_name)
|
140
|
151
|
|
|
@@ -283,7 +294,6 @@ class VpnGen:
|
283
|
294
|
files_names = glob.glob("%s%s*" % (client_dir, os.sep))
|
284
|
295
|
files_names = list(map(lambda file_path: os.path.basename(file_path), files_names))
|
285
|
296
|
|
286
|
|
-
|
287
|
297
|
call(["tar", "cfj", self.get_client_tarball_path(vpn_name, client_name),
|
288
|
298
|
"-C", client_dir] + files_names)
|
289
|
299
|
|