@@ -69,19 +69,15 @@ def install_ovnode():
6969 bash .close ()
7070 create_ccd ()
7171
72- with open ("/etc/openvpn/server/server.conf" , "a" ) as f :
73- f .write ("client-config-dir /etc/openvpn/ccd\n " )
74- f .write ("ccd-exclusive\n " )
75-
76- subprocess .run (
77- ["systemctl" , "restart" , "openvpn-server@server.service" ], check = True
78- )
79-
8072 # OV-Node configuration prompts
8173 shutil .copy (".env.example" , ".env" )
8274 example_uuid = str (uuid4 ())
83- SERVICE_PORT = input ("OV-Node service port (default 9090): " ) or "9090"
84- API_KEY = input (f"OV-Node API key (example: { example_uuid } ): " ) or example_uuid
75+ SERVICE_PORT = input ("OV-Node service port (default 9090): " )
76+ if SERVICE_PORT .strip () == "" :
77+ SERVICE_PORT = "9090"
78+ API_KEY = input (f"OV-Node API key (example: { example_uuid } ): " )
79+ if API_KEY .strip () == "" :
80+ API_KEY = example_uuid
8581
8682 replacements = {
8783 "SERVICE_PORT" : SERVICE_PORT ,
@@ -100,7 +96,7 @@ def install_ovnode():
10096 f .writelines (lines )
10197
10298 run_ovnode ()
103- input ("Press Enter to return to the menu..." )
99+ input ("Successfully installed, Press Enter to return to the menu..." )
104100 menu ()
105101
106102 except Exception as e :
@@ -201,7 +197,9 @@ def uninstall_ovnode():
201197 bash .expect ("Confirm OpenVPN removal" )
202198 bash .sendline ("y" )
203199
204- bash .expect ("OpenVPN and OV-Node removed!" )
200+ bash .expect (pexpect .EOF , timeout = 60 )
201+ bash .close ()
202+
205203 print (
206204 Fore .GREEN
207205 + "OV-Node uninstallation completed successfully!"
0 commit comments