hephaest0s / usbkill

« usbkill » is an anti-forensic kill-switch that waits for a change on your USB ports and then immediately shuts down your computer.
4.38k stars 507 forks source link

OS X shutdown can fail #64

Closed rautamiekka closed 8 years ago

rautamiekka commented 9 years ago

Since the script executes 3 commands in succession on OS X but cares about the ending signal, it can fail, that's what the && means: execute next command only if the command on the left side finished problemlessly, so I'd replace them with ; to make the commands execute in order regardless of what.

Of course, the same applies to any other single line of commands, so always use ; rather than && unless you -know- the next command must execute only if the previous one succeeds. Be warned that I read that the precedence of && and || (execute next only if previous one fails) isn't same, so running a pseudocode like

quit && kill || echo

means

quit AND kill IF quit SUCCEEDS, OTHERWISE kill AND echo
hephaest0s commented 8 years ago

Thanks.

Fixed in version 1.0-rc.3