Skip to content

Commit

Permalink
using shell variable "USER"
Browse files Browse the repository at this point in the history
  • Loading branch information
jotyGill committed Sep 24, 2017
1 parent a701351 commit ba7393e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions openpyn/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ def logged_in_user_is_root(username):

def running_with_sudo():
if verify_running_as_root():
logged_in_user = os.getlogin()
logged_in_user = print(os.environ["USER"])
if logged_in_user == "root":
return False
else:
return True
return False

'''
if logged_in_user_is_root(logged_in_user):
return False # when loggdin as 'root' user notifications will work.
return False # when logged in as 'root' user notifications will work.
else:
return True # 'sudo' is used notification won't work.
return False # regular user without 'sudo'
'''

0 comments on commit ba7393e

Please sign in to comment.