Take into account renaming to Tails in some more places.
[tails-test.git] / config / chroot_local-includes / etc / init.d / tails-wifi
blob17a5f8027084865c9e0857e662bd11e1583b26da
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: tails-wifi
4 # Required-Start: mountkernfs $local_fs
5 # Required-Stop: $local_fs
6 # Default-Start: S
7 # Default-Stop:
8 # Short-Description: Configure wireless interfaces
9 # Description: Tails-specific wireless configuration
10 ### END INIT INFO
12 # Author: amnesia <amnesia@boum.org>
14 # PATH should only include /usr/* if it runs after the mountnfs.sh script
15 PATH=/sbin:/bin
16 DESC="Tails-specific wireless configuration"
17 NAME=tails-wifi
18 IWCONFIG=/sbin/iwconfig
19 SCRIPTNAME=/etc/init.d/$NAME
21 # Exit if the package is not installed
22 [ -x "$IWCONFIG" ] || exit 0
24 # Load the VERBOSE setting and other rcS variables
25 . /lib/init/vars.sh
27 # Define LSB log_* functions.
28 # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
29 # and status_of_proc is working.
30 . /lib/lsb/init-functions
32 do_start()
34 wdevs=`iwconfig 2>/dev/null | grep -oE '^[^ ]+'`
35 for dev in ${wdevs}; do
36 iwconfig ${dev} power on
37 done
40 case "$1" in
41 start)
42 [ "$VERBOSE" != no ] && log_daemon_msg "Setting up $DESC" "$NAME"
43 do_start
44 case "$?" in
45 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
46 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
47 esac
49 restart|reload|stop|force-reload)
53 echo "Usage: $SCRIPTNAME start" >&2
54 exit 3
56 esac