Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH variable should be considered in Parser #64

Open
mobangjack opened this issue Sep 9, 2021 · 1 comment
Open

PATH variable should be considered in Parser #64

mobangjack opened this issue Sep 9, 2021 · 1 comment

Comments

@mobangjack
Copy link

class UnixParser(Parser):

@classmethod
def get_command(cls):
    ifconfig_cmd = 'ifconfig'
    for path in ['/sbin', '/usr/sbin', '/bin', '/usr/bin']: // PATH variable should be considered
        if os.path.exists(os.path.join(path, ifconfig_cmd)):
            ifconfig_cmd = os.path.join(path, ifconfig_cmd)
            break
    ifconfig_cmd = ifconfig_cmd + " -a"
    return ifconfig_cmd
@benjaoming
Copy link
Collaborator

Sounds like a great idea 👍

You are welcome to look into this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants