diff options
author | Arie Middelkoop <amiddelk@gmail.com> | 2012-02-24 01:35:59 +0000 |
---|---|---|
committer | Arie Middelkoop <amiddelk@gmail.com> | 2012-02-24 01:35:59 +0000 |
commit | 1b2d50c14f7e1a319e5c167810179a3e0e6397e3 (patch) | |
tree | edefea4d8857a9a8057400084eeb3a657ce926b1 /pkgs/os-specific/linux/rfkill/rfkill-hook.sh | |
parent | ed813f3955595ffd594570f74f406f3b6319610a (diff) | |
download | nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar.gz nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar.bz2 nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar.lz nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar.xz nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.tar.zst nixpkgs-1b2d50c14f7e1a319e5c167810179a3e0e6397e3.zip |
rfkill udev package.
svn path=/nixpkgs/trunk/; revision=32532
Diffstat (limited to 'pkgs/os-specific/linux/rfkill/rfkill-hook.sh')
-rwxr-xr-x | pkgs/os-specific/linux/rfkill/rfkill-hook.sh | 19 |
1 files changed, 19 insertions, 0 deletions
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 |