Skip to content

I have done small correction in the script #46

Description

@abidmaria

I have done small correction on David Bombal's script ( to fetch all the adapters [ if they available] not only the first adapter e.g wlan0 ) below is the correction :

pattern = r'^wlan[0-9]+'
check_wifi_result = subprocess.run(["iwconfig"], capture_output=True).stdout.decode()

wifi_adapters = re.findall(pattern,check_wifi_result,re.MULTILINE)

if len(wifi_adapters) == 0:
print("Please connect a WiFi adapter and try again.")
exit()

print("The following WiFi interfaces are available:")
for index, item in enumerate(wifi_adapters):
print(f"{index} - {item}")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions