All pastes #1737488 Raw Edit

btprox.sh

public shellscript v1 · immutable
#1737488 ·published 2010-01-04 15:40 UTC
rendered paste body
#!/bin/sh## Monitors bluetooth looking for a specific device; if the# device is not present, lock the screen## Device to look for. Either name or hex address will work.#DEVICE=00:25:CF:AA:A0:ACDEVICE=Marsbard# User to run screensaver asUSER=martianif [ "$(id -u)" != "0" ]; then         echo "This script must be run as root" 1>&2         exit 1 fiwhile [ 1 = 1 ]do        hcitool scan | grep $DEVICE 2>&1 > /dev/null        if [ "$?" = "1" ]        then                su $USER -c "gnome-screensaver-command -a"                sleep 60        fi        sleep 5done