Make process path dynamic
This commit is contained in:
parent
25cbcd97e5
commit
d67462ecfe
11
README.md
11
README.md
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
``./pyvpn --create-client [clientname]``
|
``pyvpn --create-client [clientname]``
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
|
@ -35,7 +35,14 @@ You need to have Python installed for this to work.
|
||||||
|
|
||||||
Move the script to the scripts directory:
|
Move the script to the scripts directory:
|
||||||
|
|
||||||
``mv pyVPN.py /usr/local/bin/pyvpn``
|
From the repository you just cloned,
|
||||||
|
|
||||||
|
Source the path environment variable:
|
||||||
|
``source ./.env``
|
||||||
|
|
||||||
|
Then install the program: ``mv pyVPN.py /usr/local/bin/pyvpn``
|
||||||
|
|
||||||
|
Confirm that the path ``echo $PYVPN_PROCESS_PATH`` is correct. If not, adjust the env file and resource.
|
||||||
|
|
||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|
4
pyVPN.py
4
pyVPN.py
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import pexpect
|
import pexpect
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -7,7 +8,8 @@ import base64
|
||||||
|
|
||||||
# This script can probably use some improvement
|
# This script can probably use some improvement
|
||||||
|
|
||||||
process = "/root/openvpn-install/openvpn-installer.sh"
|
process = os.environ['PYVPN_PROCESS_PATH']
|
||||||
|
|
||||||
operatingDir = "/root"
|
operatingDir = "/root"
|
||||||
|
|
||||||
fScript = pexpect.spawn("/bin/bash" + process)
|
fScript = pexpect.spawn("/bin/bash" + process)
|
||||||
|
|
Loading…
Reference in New Issue