summaryrefslogtreecommitdiff
path: root/core/rfkill/rfkill.rc.d
blob: ce90ee150248ed86f4d495a5624468d729733d1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/rfkill

case "$1" in
  start)
    for device in ${RFKILL_BLOCK}; do
      stat_busy "Blocking rfkill device: ${device}"
      /usr/sbin/rfkill block ${device}
      if [ $? -eq 0 ]; then
        stat_done
      else
        stat_fail
      fi
    done
    for device in ${RFKILL_UNBLOCK}; do
      stat_busy "Unblocking rfkill device: ${device}"
      /usr/sbin/rfkill unblock ${device}
      if [ $? -eq 0 ]; then
        stat_done
      else
        stat_fail
      fi
    done
    ;;
  stop)
    ;;
  restart)
    $0 start
    ;;
  *)
    echo "usage: $0 {start}"
    exit 1
    ;;
esac
exit 0