-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·76 lines (60 loc) · 2.27 KB
/
setup.sh
File metadata and controls
executable file
·76 lines (60 loc) · 2.27 KB
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
75
76
#!/bin/bash
# 必須以 root 權限執行
if [ "$EUID" -ne 0 ]; then
echo "請使用 sudo 執行此腳本"
exit 1
fi
# ==== for ip show====
sudo ./scripts/enable_i2c.sh
sudo apt-get install -y python3-pip python3-dev python3-smbus i2c-tools
sudo pip3 install --break-system-packages netifaces
sudo pip3 install --break-system-packages luma.oled
cd ./scripts/ip_show
sudo chmod +x setup_ip_show.sh
sudo ./setup_ip_show.sh
cd ../..
# ==== for boot logo ====
# I2C 和 OLED 驅動都設定好了,現在安裝開機 logo
cd ./scripts/boot_logo
sudo chmod +x install_boot_logo.sh
sudo ./install_boot_logo.sh
cd ../..
sudo ./setup_hackmasterpi.sh
# ==== for PN532 ====
# sudo ./scripts/enable_i2c.sh
# sudo apt install -y i2c-tools
sudo apt install -y libnfc-dev libnfc-bin libnfc-examples
# sudo apt install -y python3-pip python3-dev
sudo pip3 install --break-system-packages pn532pi binascii
sudo mkdir -p /etc/nfc
cat > /etc/nfc/libnfc.conf << EOF
# PN532 via I2C connection
device.name = "PN532"
device.connstring = "pn532_i2c:/dev/i2c-1"
EOF
sudo usermod -a -G i2c $(whoami)
newgrp i2c
# ==== for apple_bleee ====
echo "pi ALL=(ALL) NOPASSWD: /usr/bin/python3 ./app/mylib/apple_blee/adv_airpods.py" | sudo tee /etc/sudoers.d/user-python && sudo chmod 440 /etc/sudoers.d/user-python
sudo apt install -y bluez libpcap-dev libev-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev cmake libbluetooth-dev
sudo apt install git
sudo pip3 install --break-system-packages -r ./app/mylib/apple_bleeerequirements.txt
git clone https://github.com/seemoo-lab/owl.git && cd ./owl && git submodule update --init && mkdir build && cd build && cmake .. && make && sudo make install && cd ../..
# ==== for beacon ====
sudo apt install bluez bluez-tools -y
# === for ir ===
sudo apt-get install python3-rpi.gpio
# ==== for WiFi 網卡驅動 (8812AU) ====
echo "正在安裝 WiFi 網卡驅動 (8812AU)..."
cd ~
git clone https://github.com/morrownr/8812au-20210820.git
cd 8812au-20210820
# 安裝編譯所需的套件
sudo apt update
sudo apt install -y dkms build-essential bc
# 編譯和安裝驅動程式
sudo ./install-driver.sh
# 回到原始目錄
cd /home/pi/HackMaster-Pi
echo "WiFi 網卡驅動安裝完成,建議重新啟動系統以確保驅動程式正常載入"
echo "執行 'sudo reboot' 來重新啟動系統"