forked from open-sdr/openwifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_config.sh
executable file
·75 lines (61 loc) · 1.6 KB
/
post_config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
set -ex
MACHINE_TYPE=`uname -m`
# setup kernel module directory
if [ -d "/lib/modules/$(uname -r)" ]; then
echo "/lib/modules/$(uname -r) already exists."
else
if [ ${MACHINE_TYPE} == 'aarch64' ]; then
ln -s /lib/modules/adi-linux-64 /lib/modules/$(uname -r)
else
ln -s /lib/modules/adi-linux /lib/modules/$(uname -r)
fi
fi
depmod
modprobe mac80211
if [ ${MACHINE_TYPE} == 'aarch64' ]; then
cp ~/openwifi/drv64/* ~/openwifi/ -rf
else
cp ~/openwifi/drv32/* ~/openwifi/ -rf
fi
# add gateway (PC) for internet access
route add default gw 192.168.10.1 || true
sudo apt update
chmod +x *.sh
# build sdrctl
sudo apt-get -y install libnl-3-dev
sudo apt-get -y install libnl-genl-3-dev
cd sdrctl_src
make
cp sdrctl ../
cd ../side_ch_ctl_src/
gcc -o side_ch_ctl side_ch_ctl.c
cp side_ch_ctl ../
cd ..
# install and setup dhcp server
sudo apt-get -y install isc-dhcp-server
cp dhcpd.conf /etc/dhcp/dhcpd.conf
# install hostapd and other useful tools
sudo apt-get -y install hostapd
sudo apt-get -y install nano
sudo apt-get -y install tcpdump
sudo apt-get -y install webfs
sudo apt-get -y install iperf
sudo apt-get -y install iperf3
sudo apt-get -y install libpcap-dev
sudo apt-get -y install bridge-utils
cd ./inject_80211/
make
# change the root password to openwifi
cat /etc/passwd
sed -i 's/root:x:0:0:root:\/root:\/bin\/bash/root::0:0:root:\/root:\/bin\/bash/' /etc/passwd
sync
sleep 1
cat /etc/passwd
echo -e "openwifi\nopenwifi" | passwd
sync
sleep 1
cat /etc/passwd