blob: a5d9acfcfd6a3f6283aa9ed68d46d5f1354bee63 [file] [log] [blame]
bohub1733552017-05-26 10:27:34 -07001#!/vendor/bin/sh
bohu06600752016-12-27 11:03:41 -08002
Weilun Du697c7992020-04-13 15:57:38 -07003# Check if VirtIO Wi-Fi is enabled. If so, run the DHCP client
4
5wifi_virtio=`getprop ro.kernel.qemu.virtiowifi`
6case "$wifi_virtio" in
7 1) setprop ctl.start dhcpclient_wifi
8 ;;
9esac
10
11# Check if WiFi with mac80211_hwsim is enabled. If so, run the WiFi init script. If not we just
Bjoern Johanssonbf93db32017-07-14 15:47:19 -070012# have to run the DHCP client in the default namespace and that will set up
13# all the networking.
Weilun Du697c7992020-04-13 15:57:38 -070014wifi_hwsim=`getprop ro.kernel.qemu.wifi`
15case "$wifi_hwsim" in
Bjoern Johanssond154a212017-08-31 13:48:45 -070016 1) /vendor/bin/init.wifi.sh
Bjoern Johansson00455fa2017-02-09 22:37:51 -080017 ;;
Bjoern Johanssonbf93db32017-07-14 15:47:19 -070018 *) setprop ctl.start dhcpclient_def
bohu06600752016-12-27 11:03:41 -080019 ;;
20esac
21
bohu06600752016-12-27 11:03:41 -080022# set up the second interface (for inter-emulator connections)
23# if required
24my_ip=`getprop net.shared_net_ip`
25case "$my_ip" in
26 "")
27 ;;
28 *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
29 ;;
30esac
31