Giter Site home page Giter Site logo

Comments (8)

drewreece avatar drewreece commented on July 16, 2024

Changing the function get_wifi_info() to enable wifi if it is off seems to fix it ...
but it does result in the wifi state changing permanently & potentially could alert the user.
If the state is turned back off it breaks the ability to get the access point scan data for the geo module. get_wifi_access_points() (modules/geo/functions) will also use the airport command but the wifi card will be in its disabled state.

I think prey should detect the wifi state and then return it to this state after completing any scans etc.

Here is my changed function.

get_wifi_info() {
wifi_info=$airport -I | grep -v "Off"
if [ -n $wifi_info ]; then
# Turn on wifi
networksetup -setairportpower Airport on 2>/dev/null
wifi_info=$airport -I | grep -v "Off"
fi
}

from prey-bash-client.

drewreece avatar drewreece commented on July 16, 2024

Added to my fork…
http://github.com/drewreece/prey

…but I'm too stupid to add a commit message !

from prey-bash-client.

tomas avatar tomas commented on July 16, 2024

Merged! Closing...

from prey-bash-client.

drewreece avatar drewreece commented on July 16, 2024

Sorry Tomas, you need to pull again, I reviewed it and it broke. There were too many arguments for the if statement and the test for nonzero (-n) was backwards, it needs to be a test for zero (-z).

Sorry

from prey-bash-client.

tomas avatar tomas commented on July 16, 2024

I believe we're done with this (on 0.4.4), are we not?

from prey-bash-client.

drewreece avatar drewreece commented on July 16, 2024

This is in 0.4.4 but I tried testing on a new install of OSX & I couldn't get a connection to work when my access point was set to no security. I think I need to create a new access point & run some more tests.

from prey-bash-client.

tomas avatar tomas commented on July 16, 2024

Any news drew? We're about to pack a new release so it would be great to make sure this bug is out.

from prey-bash-client.

drewreece avatar drewreece commented on July 16, 2024

Tomas,
The -n test fails to activate the wifi (when connected via ethernet) for an access point scan. If the test is -z the wifi will be activated.

The 0.4.4 release is correct with the -z test.

Cheers,
Drew

from prey-bash-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.