Skip to content

Fix togglewifi: interpolate Interface variable#5

Open
somethingwithproof wants to merge 1 commit intofrankroeder:masterfrom
somethingwithproof:fix-togglewifi-variable
Open

Fix togglewifi: interpolate Interface variable#5
somethingwithproof wants to merge 1 commit intofrankroeder:masterfrom
somethingwithproof:fix-togglewifi-variable

Conversation

@somethingwithproof
Copy link

The Interface variable on lines 21 and 24 is inside a quoted string, so AppleScript treats it as the literal string "Interface" rather than the value of the variable ("en0"). The networksetup -setairportpower calls never actually reference the right interface.

Fixed by concatenating the variable into the command string with &.

The variable was passed as the literal string "Interface" instead
of being concatenated into the shell command. Wi-Fi never actually
toggled.
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

Successfully merging this pull request may close these issues.

1 participant