View | Details | Raw Unified | Return to bug 11647
Collapse All | Expand All

(-)a/etc/net/scripts/config-wireless (-3 / +5 lines)
Lines 29-38 if [ -x "${IWCONFIG:=$DEFAULT_IWCONFIG}" ]; then Link Here
29
fi
29
fi
30
30
31
# configure WPA
31
# configure WPA
32
if [ -x "${WPA_SUPPLICANT:=$DEFAULT_WPA_SUPPLICANT}" ]; then
32
if [ -x "${WPA_SUPPLICANT:=$DEFAULT_WPA_SUPPLICANT}" -a \
33
	-x "${WPA_CLI:=$DEFAULT_WPA_CLI}" ]; then
33
	prof_conf=`profiled_filename $MYIFACEDIR/wpa_supplicant.conf`
34
	prof_conf=`profiled_filename $MYIFACEDIR/wpa_supplicant.conf`
34
	if [ -s "$prof_conf" ]; then
35
	if [ -s "$prof_conf" ]; then
35
		$WPA_SUPPLICANT -i$NAME${WPA_DRIVER:+ -D$WPA_DRIVER} -c $prof_conf 2>&1>/dev/null &
36
		$WPA_SUPPLICANT -i$NAME${WPA_DRIVER:+ -D$WPA_DRIVER} \
36
		echo $! >/var/run/wpa_supplicant-$NAME.pid
37
			-B -P/var/run/wpa_supplicant-$NAME.pid -c $prof_conf
38
		$WPA_CLI -i$NAME -B -P/var/run/wpa_cli-$NAME.pid -a $SCRIPTDIR/wpa_cli.action
37
	fi
39
	fi
38
fi
40
fi
(-)a/etc/net/scripts/functions (-1 / +2 lines)
Lines 18-23 DEFAULT_IFPLUGD=/usr/sbin/ifplugd Link Here
18
DEFAULT_IWPRIV=/sbin/iwpriv
18
DEFAULT_IWPRIV=/sbin/iwpriv
19
DEFAULT_IWCONFIG=/sbin/iwconfig
19
DEFAULT_IWCONFIG=/sbin/iwconfig
20
DEFAULT_WPA_SUPPLICANT=/usr/sbin/wpa_supplicant
20
DEFAULT_WPA_SUPPLICANT=/usr/sbin/wpa_supplicant
21
DEFAULT_WPA_CLI=/usr/sbin/wpa_cli
21
DEFAULT_PLIPCONFIG=/sbin/plipconfig
22
DEFAULT_PLIPCONFIG=/sbin/plipconfig
22
DEFAULT_VCONFIG=/usr/bin/vconfig
23
DEFAULT_VCONFIG=/usr/bin/vconfig
23
DEFAULT_IPSECADM=/usr/sbin/ipsecadm
24
DEFAULT_IPSECADM=/usr/sbin/ipsecadm
Lines 501-507 declare -frx modprobe_with_rename Link Here
501
declare -frx eval_string
502
declare -frx eval_string
502
declare -rx DENOISE DEFAULT_BONDMODE IFACEDIR LOCALSCRIPTDIR VARLIBDIR
503
declare -rx DENOISE DEFAULT_BONDMODE IFACEDIR LOCALSCRIPTDIR VARLIBDIR
503
declare -rx VLANTAB HOSTTAB IFTAB PROFILE_FILE PROC_CMDLINE DEFAULT_IFPLUGSTATUS
504
declare -rx VLANTAB HOSTTAB IFTAB PROFILE_FILE PROC_CMDLINE DEFAULT_IFPLUGSTATUS
504
declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_PLIPCONFIG
505
declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_WPA_CLI DEFAULT_PLIPCONFIG
505
declare -rx DEFAULT_VCONFIG DEFAULT_PENTANETT DEFAULT_PENTAVALT DEFAULT_PENTANET_CONF
506
declare -rx DEFAULT_VCONFIG DEFAULT_PENTANETT DEFAULT_PENTAVALT DEFAULT_PENTANET_CONF
506
declare -rx DEFAULT_PENTAVAL_CONF DEFAULT_IPSECADM DEFAULT_IFENSLAVE DEFAULT_BRCTL
507
declare -rx DEFAULT_PENTAVAL_CONF DEFAULT_IPSECADM DEFAULT_IFENSLAVE DEFAULT_BRCTL
507
declare -rx DEFAULT_ETHTOOL DEFAULT_PPPD DEFAULT_CHAT DEFAULT_PPPOPTIONSFILE
508
declare -rx DEFAULT_ETHTOOL DEFAULT_PPPD DEFAULT_CHAT DEFAULT_PPPOPTIONSFILE
(-)a/etc/net/scripts/ifdown-ifplugd (-6 / +8 lines)
Lines 51-65 case "$BOOTPROTO" in Link Here
51
	;;
51
	;;
52
esac
52
esac
53
53
54
case "$USE_IFPLUGD" in
54
if [ "${0##/*}" = "ifdown-ifplugd" ]; then
55
	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|[Yy]|1|[Aa][Uu][Tt][Oo])
55
	case "$USE_IFPLUGD" in
56
		[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|[Yy]|1|[Aa][Uu][Tt][Oo])
56
		# It's Ok, just do the job.
57
		# It's Ok, just do the job.
57
	;;
58
		;;
58
	*)
59
		*)
59
		print_error "ERROR: USE_IFPLUGD is not enabled for $NAME"
60
		print_error "ERROR: USE_IFPLUGD is not enabled for $NAME"
60
		exit 1
61
		exit 1
61
	;;
62
		;;
62
esac
63
	esac
64
fi
63
65
64
ExecIfExecutable $LOCALSCRIPTDIR/ifdown-pre-local $NAME && print_progress
66
ExecIfExecutable $LOCALSCRIPTDIR/ifdown-pre-local $NAME && print_progress
65
ExecIfExecutable $MYIFACEDIR/ifdown-pre $NAME && print_progress
67
ExecIfExecutable $MYIFACEDIR/ifdown-pre $NAME && print_progress
(-)a/etc/net/scripts/ifup-common (-5 / +10 lines)
Lines 184-201 process_sysctl_conf() Link Here
184
	return 0
184
	return 0
185
}
185
}
186
186
187
if ! is_yes $IN_WPA_CLI; then	# non-wifi or first pass for wifi
187
# setup link-level params
188
# setup link-level params
188
xargise_file $IFACEDIR/default/iplink "$IP link set dev $NAME"
189
    xargise_file $IFACEDIR/default/iplink "$IP link set dev $NAME"
189
xargise_file $IFACEDIR/default/iplink-$TYPE "$IP link set dev $NAME"
190
    xargise_file $IFACEDIR/default/iplink-$TYPE "$IP link set dev $NAME"
190
xargise_file $MYIFACEDIR/iplink "$IP link set dev $NAME"
191
    xargise_file $MYIFACEDIR/iplink "$IP link set dev $NAME"
191
192
192
# bring iface up
193
# bring iface up
193
if ! is_yes $KEEP_DOWN; then
194
    if ! is_yes $KEEP_DOWN; then
194
	$IP link set dev $NAME up && print_progress
195
	$IP link set dev $NAME up && print_progress
196
    fi
195
fi
197
fi
196
198
197
# handle wireless extensions
199
# handle wireless extensions
198
is_yes "$CONFIG_WIRELESS" && $SCRIPTDIR/config-wireless $NAME && print_progress
200
if is_yes "$CONFIG_WIRELESS" && ! is_yes $IN_WPA_CLI; then
201
    $SCRIPTDIR/config-wireless $NAME && print_progress
202
    exit 0
203
fi
199
204
200
# process ip neighbours
205
# process ip neighbours
201
xargise_file $MYIFACEDIR/ipneigh "$IP neigh replace dev $NAME"
206
xargise_file $MYIFACEDIR/ipneigh "$IP neigh replace dev $NAME"
(-)a/etc/net/scripts/ifup-ifplugd (-2 / +12 lines)
Lines 13-19 usage() Link Here
13
[ -z "$1" ] && usage
13
[ -z "$1" ] && usage
14
export NAME=$1
14
export NAME=$1
15
15
16
# forget everything we have inherited from ifplugd
16
# forget everything we have inherited from ifplugd/wpa_cli
17
export SCRIPTDIR=/etc/net/scripts
17
export SCRIPTDIR=/etc/net/scripts
18
. $SCRIPTDIR/functions
18
. $SCRIPTDIR/functions
19
pickup_defaults
19
pickup_defaults
Lines 37-40 is_yes "$DISABLED" && { Link Here
37
seen_iface $NAME && exit 0
37
seen_iface $NAME && exit 0
38
add_seen_iface $NAME
38
add_seen_iface $NAME
39
export SEEN_IFACES
39
export SEEN_IFACES
40
IN_IFPLUGD=yes $SCRIPTDIR/ifup-common $NAME
40
case "$0" in
41
    *ifup-ifplugd)
42
    IN_WPA_CLI=no IN_IFPLUGD=yes $SCRIPTDIR/ifup-common $NAME
43
    ;;
44
    *ifup-wireless)
45
    USE_IFPLUGD=no IN_IFPLUGD=no IN_WPA_CLI=yes $SCRIPTDIR/ifup-common $NAME
46
    ;;
47
    *)
48
    $SCRIPTDIR/ifup-common $NAME
49
    ;;
50
esac
(-)a/etc/net/scripts/wpa_cli.action (+17 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# This file is /etc/net helper for use with wpa_cli action mode
4
# and called from wpa_cli with two parameters:
5
# $1 interface name
6
# $2 event, CONNECTED|DISCONNECTED
7
8
if [ -z "$1" -o -z "$2" ] ; then
9
    logger -d "Wrong arguments to $0: '$@'"
10
    exit 1
11
fi
12
13
unset SEEN_IFACES
14
[ "$2" = "CONNECTED" ] && exec /etc/net/scripts/ifup-wireless $1
15
[ "$2" = "DISCONNECTED" ] && exec /etc/net/scripts/ifdown-wireless $1
16
17
exit 0

Return to bug 11647