Created
September 4, 2017 12:18
-
-
Save sd65/47f6ba4a8018118ffe6af692e283a13a to your computer and use it in GitHub Desktop.
Prevent laptop grab theft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEVICE="$1" | |
SCAN_DELAY=10 | |
trap ctrl_c INT | |
function ctrl_c() { | |
echo "Shutting down..." | |
exit 0 | |
} | |
[[ -z "$DEVICE" ]] && echo "Please provide an BT MAC as first argument." && exit 1 | |
echo "Starting..." | |
while sudo hcitool info $DEVICE >/dev/null 2>&1; do | |
echo "[OK] REACHABLE" | |
sleep $SCAN_DELAY | |
done | |
echo "[ERROR] Device $DEVICE is not reachable ! Locking screen." | |
cinnamon-screensaver-command -l -m "Potential theft detected" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment