1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-02 18:42:15 +00:00
nixpkgs/pkgs/os-specific/linux/rfkill/rfkill-hook.sh
Arie Middelkoop 1b2d50c14f rfkill udev package.
svn path=/nixpkgs/trunk/; revision=32532
2012-02-24 01:35:59 +00:00

19 lines
461 B
Bash
Executable file

#!/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