From 1b2d50c14f7e1a319e5c167810179a3e0e6397e3 Mon Sep 17 00:00:00 2001 From: Arie Middelkoop Date: Fri, 24 Feb 2012 01:35:59 +0000 Subject: rfkill udev package. svn path=/nixpkgs/trunk/; revision=32532 --- pkgs/os-specific/linux/rfkill/rfkill-hook.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 pkgs/os-specific/linux/rfkill/rfkill-hook.sh (limited to 'pkgs/os-specific/linux/rfkill/rfkill-hook.sh') diff --git a/pkgs/os-specific/linux/rfkill/rfkill-hook.sh b/pkgs/os-specific/linux/rfkill/rfkill-hook.sh new file mode 100755 index 00000000000..d07c7298183 --- /dev/null +++ b/pkgs/os-specific/linux/rfkill/rfkill-hook.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Executes a hook in case of a change to the +# rfkill state. The hook can be passed as +# environment variable, or present as executable +# file. + +if [ -z "$RFKILL_STATE" ]; then + echo "rfkill-hook: error: RFKILL_STATE variable not set" + exit 1 +fi + +if [ -x /var/run/current-system/etc/rfkill.hook ]; then + exec /var/run/current-system/etc/rfkill.hook +elif [ ! -z "$RFKILL_HOOK" ]; then + exec $RFKILL_HOOK +else + echo "rfkill-hook: $RFKILL_STATE" +fi \ No newline at end of file -- cgit 1.4.1