blob: 588f2104653789e8d15f1b7e4648aacc5f25611c [file] [log] [blame]
bohub1733552017-05-26 10:27:34 -07001#!/vendor/bin/sh
bohu06600752016-12-27 11:03:41 -08002
Weilun Dua56cfaa2021-04-15 22:03:21 -07003# Check if VirtIO Wi-Fi is enabled. If so, create a mac80211_hwsim radio
4# and run the DHCP client
Roman Kiryanovd6a8d3c2021-04-12 13:35:35 -07005wifi_virtio=`getprop ro.boot.qemu.virtiowifi`
Weilun Du697c7992020-04-13 15:57:38 -07006case "$wifi_virtio" in
Weilun Dua56cfaa2021-04-15 22:03:21 -07007 1) wifi_mac_prefix=`getprop vendor.net.wifi_mac_prefix`
8 if [ -n "$wifi_mac_prefix" ]; then
9 /vendor/bin/mac80211_create_radios 1 $wifi_mac_prefix || exit 1
10 fi
11 setprop ctl.start dhcpclient_wifi
12 ;;
Weilun Du697c7992020-04-13 15:57:38 -070013esac
14
bohu06600752016-12-27 11:03:41 -080015# set up the second interface (for inter-emulator connections)
16# if required
Weilun Duaa1fed62021-02-18 17:18:34 -080017my_ip=`getprop vendor.net.shared_net_ip`
bohu06600752016-12-27 11:03:41 -080018case "$my_ip" in
19 "")
20 ;;
21 *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
22 ;;
23esac
24