Skip to content

Commit

Permalink
minor tidy up, and fix some copy & paste problems from patchoo.
Browse files Browse the repository at this point in the history
  • Loading branch information
loceee committed Oct 15, 2014
1 parent 81f0807 commit 28ed4a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions FVHelper/fvhelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,25 @@ checkProcess()

checkConsoleStatus()
{
psauxout="$(ps aux)"
userloggedin="$(who | grep console | awk '{print $1}')"
consoleuser="$(ls -l /dev/console | awk '{print $3}')"
screensaver="$(echo $psauxout | grep ScreenSaverEngine | grep -v grep)"
screensaver="$(ps aux | grep ScreenSaverEngine | grep -v grep)"

if [ "$screensaver" != "" ]
if [ "${screensaver}" != "" ]
then
# screensaver is running
echo "screensaver"
return
fi

if [ "$userloggedin" == "" ]
if [ "${userloggedin}" == "" ]
then
# no users logged in (at loginwindow)
echo "nologin"
return
fi

if [ "$userloggedin" != "$consoleuser" ]
if [ "${userloggedin}" != "${consoleuser}" ]
then
# a user is loggedin, but we are at loginwindow or we have multiple users logged in with switching (too hard for now)
echo "loginwindow"
Expand All @@ -67,7 +66,7 @@ logoutUser()
{
waitforlogout=30
# sending appleevent seems most robust and fastest way, can still be blocked by stuck app (I'm looking at you MS Office and Lync)
secho "sending logout ..."
echo "sending logout ..."
osascript -e "ignoring application responses" -e "tell application \"loginwindow\" to $(printf \\xc2\\xab)event aevtrlgo$(printf \\xc2\\xbb)" -e "end ignoring"

while [ "$(checkConsoleStatus)" != "nologin" ]
Expand Down
2 changes: 1 addition & 1 deletion FVHelper/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Vague instructions

1. Setup your FV config (set it to run at **Current or Next User**) equiv of. *fdsetup -defer*
3. Setup a smart group to catch eligible computers
* FileVault 2 Eligibility ** is Eligible **
* FileVault 2 Eligibility **is Eligible**
* **AND** **(** FileVault 2 Partition Encryp State **is not Encrypted**
* **AND** File Vault 2 Partition 2 Encrypt State **is not Encrypting )**
* **AND** ... your other criteria (eg. computer model like **book**).
Expand Down

0 comments on commit 28ed4a9

Please sign in to comment.