1#!/bin/bash 2 3set -ex 4 5# setup kernel module directory 6if [ -d "/lib/modules/$(uname -r)" ]; then 7 echo "/lib/modules/$(uname -r) already exists." 8else 9 ln -s /lib/modules/openwifi /lib/modules/$(uname -r) 10fi 11depmod 12modprobe mac80211 13 14# add gateway (PC) for internet access 15route add default gw 192.168.10.1 || true 16 17# build sdrctl 18sudo apt-get -y install libnl-3-dev 19sudo apt-get -y install libnl-genl-3-dev 20cd sdrctl_src 21make 22cp sdrctl ../ 23cd .. 24 25# install and setup dhcp server 26sudo apt-get -y install isc-dhcp-server 27cp dhcpd.conf /etc/dhcp/dhcpd.conf 28 29# install hostapd and other useful tools 30sudo apt-get -y install hostapd 31sudo apt-get -y install nano 32sudo apt-get -y install tcpdump 33sudo apt-get -y install webfs 34sudo apt-get -y install iperf 35 36# change the password to openwifi 37echo -e "openwifi\nopenwifi" | passwd 38