password anti-disclosure for python script
This commit is contained in:
@@ -5,7 +5,11 @@ import pexpect
|
|||||||
|
|
||||||
# Read variables of first and second given argument
|
# Read variables of first and second given argument
|
||||||
user = str(sys.argv[1])
|
user = str(sys.argv[1])
|
||||||
password = str(sys.argv[2])
|
passwordfile = str(sys.argv[2])
|
||||||
|
|
||||||
|
# Read content of passwordfile and put as variable "password"
|
||||||
|
with open (passwordfile, "r") as myfile:
|
||||||
|
password=myfile.read().replace('\n', '')
|
||||||
|
|
||||||
# Define function
|
# Define function
|
||||||
def _vadduser(user, password):
|
def _vadduser(user, password):
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ passwordfile = str(sys.argv[2])
|
|||||||
with open (passwordfile, "r") as myfile:
|
with open (passwordfile, "r") as myfile:
|
||||||
password=myfile.read().replace('\n', '')
|
password=myfile.read().replace('\n', '')
|
||||||
|
|
||||||
|
|
||||||
# Define function
|
# Define function
|
||||||
def _vchangepw(user, password):
|
def _vchangepw(user, password):
|
||||||
changepw = pexpect.spawn(
|
changepw = pexpect.spawn(
|
||||||
|
|||||||
Reference in New Issue
Block a user