1#!/vendor/bin/sh
2
3# 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
12# have to run the DHCP client in the default namespace and that will set up
13# all the networking.
14wifi_hwsim=`getprop ro.kernel.qemu.wifi`
15case "$wifi_hwsim" in
16    1) /vendor/bin/init.wifi.sh
17       ;;
18    *) setprop ctl.start dhcpclient_def
19       ;;
20esac
21
22# 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
32