File: ifupdown-rfkill

package info (click to toggle)
ifupdown 0.8.44
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 952 kB
  • sloc: ansic: 2,781; sh: 899; perl: 513; makefile: 90
file content (23 lines) | stat: -rwxr-xr-x 433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
CHANGE=$3
SYSFS=$1
DEVICE=$SYSFS$2

PATH='/sbin:/bin:/usr/sbin:/usr/bin'

if [ -e $DEVICE ] ; then
	while [ $DEVICE != $SYSFS ] ; do
		DEVICE=`dirname $DEVICE`

		if [ -d $DEVICE/net ] ; then
			for INTERFACE in $DEVICE/net/* ; do
				INTERFACE=`basename $INTERFACE`
				
				case $CHANGE in
					"1")     ifup   --allow=rfkill $INTERFACE ;;
					"0"|"2") ifdown --allow=rfkill $INTERFACE ;;
				esac
			done
		fi
	done
fi