This commit is contained in:
mantaohuang 2020-07-25 19:36:41 -04:00
parent 28d1efaebd
commit b2d5bc92a3

View File

@ -39,8 +39,6 @@ class OManager:
folder_path = os.path.join(self.base_folder, f"session{self.new_idx}") folder_path = os.path.join(self.base_folder, f"session{self.new_idx}")
if not os.path.isdir(folder_path): if not os.path.isdir(folder_path):
os.makedirs(folder_path) os.makedirs(folder_path)
if not name:
name = f"openvpn-{self.new_idx}"
os.system(f"groupadd vpn{self.new_idx}") os.system(f"groupadd vpn{self.new_idx}")
env_config = { env_config = {
"folder_path": folder_path, "folder_path": folder_path,
@ -58,6 +56,8 @@ class OManager:
return op return op
def new_op_old(self, cfg_fp, name=None, additional_cfg={}): def new_op_old(self, cfg_fp, name=None, additional_cfg={}):
if not name:
name = f"openvpn-{self.new_idx}"
ovpn_config = { ovpn_config = {
"cfg_fp": cfg_fp, "cfg_fp": cfg_fp,
"name": name, "name": name,