kevva / wifi-password

Get current wifi password
MIT License
617 stars 54 forks source link

Command failed #2

Closed iamskok closed 9 years ago

iamskok commented 9 years ago

I get this error when I execute wifi-password:

Command failed: /bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: syntax error: unexpected end of file

kevva commented 9 years ago

@Skoks, OS X?

iamskok commented 9 years ago

@kevva Yes, Sir!

I'm also using Zsh, if that somehow matters...

mischah commented 9 years ago

Same here. OS X 10.9.5 using the default bash.

kevva commented 9 years ago

@mischah, I've updated the command, could you try installing directly from the repo and try?

anselmh commented 9 years ago

I think related to this:

Command failed: sed: 1: "s/^.*"\(.*)".*$/\1/
": RE error: parentheses not balanced

If not related, let me know. Using zsh and the latest npm version of this tool.

mischah commented 9 years ago

Using the latest from master branch. Now it says:

Command failed: sed: 1: "s/^.*"\(.*)".*$/\1/
": RE error: parentheses not balanced
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

Pretty much the same message that @anselmh mentioned before.

kevva commented 9 years ago

Alright, could you run security find-generic-password -ga your-wifi-name for me so I can have a look at the output. I think it's better to parse it using JS instead of sed etc.

anselmh commented 9 years ago

Sure:

keychain: "/Library/Keychains/System.keychain"
class: "genp"
attributes:
    0x00000007 <blob>="networkname"
    0x00000008 <blob>=<NULL>
    "acct"<blob>="networkname"
    "cdat"<timedate>=0x32303134313132373038313731365A00  "20141127081716Z\000"
    "crtr"<uint32>=<NULL>
    "cusi"<sint32>=<NULL>
    "desc"<blob>="AirPort network password"
    "gena"<blob>=<NULL>
    "icmt"<blob>=<NULL>
    "invi"<sint32>=<NULL>
    "mdat"<timedate>=0x32303134313132373038313731365A00  "20141127081716Z\000"
    "nega"<sint32>=<NULL>
    "prot"<blob>=<NULL>
    "scrp"<sint32>=<NULL>
    "svce"<blob>="AirPort"
    "type"<uint32>=<NULL>
password: "password"
kevva commented 9 years ago

Are you connected to a network? Seems like you're not.

anselmh commented 9 years ago

Sorry, updated now. Forgot to change network name :D

kevva commented 9 years ago

Alright, thanks :).

kevva commented 9 years ago

@Skoks, @mischah, @anselmh, should be fixed now!

iamskok commented 9 years ago

@kevva Still not working for me... I have tried it on another Mac OS machine with zsh. Screenshot @mischah, @anselmh What about you guys ?

kevva commented 9 years ago

@Skoks, you have to install the new version globally too. You've only installed that one locally.

iamskok commented 9 years ago

@kevva After installing it globally and running wifi-password Mac OS prompts for username and password (I guess it's because I have to run node with sudo). After providing credentials wifi-password outputs null