@@ -8,16 +8,23 @@ function fail {
8
8
echo " ### RPI-KVM Install ##############"
9
9
echo " --- RPI-KVM Dependency Install ---"
10
10
echo " Install required basic packages via apt-get"
11
- sudo apt-get install git tmux python python3 python-dev python3-dev python3-pip -y
11
+ sudo apt update
12
+ sudo apt-get install git tmux python-is-python3 python3 python3-dev python3-pip -y
12
13
echo " Install required bluetooth packages via apt-get"
13
14
sudo apt-get install bluez bluez-tools bluez-firmware python3-bluez -y
14
- echo " Install required python packages via pip3"
15
- sudo pip3 install evdev dbus-next aiohttp RPi.GPIO
16
15
echo " Install required python packages via apt-get"
17
- sudo apt-get install python3-pyudev python3-evdev python3-dbus python3-numpy python3-gi -y
18
- echo " Install dev tools"
19
- curl -sSL https://deb.nodesource.com/setup_16.x | sudo bash -
20
- sudo apt install -y nodejs
16
+ sudo apt-get install python3-pyudev python3-evdev python3-dbus python3-dbus-next python3-aiohttp python3-rpi.gpio python3-numpy python3-gi -y
17
+ echo " Install nodejs"
18
+ sudo apt-get update
19
+ sudo apt-get install -y ca-certificates curl gnupg
20
+ sudo mkdir -p /etc/apt/keyrings
21
+ # --yes allows overwriting if re-running the script (to repair a broken install or get new fixes)
22
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor --yes -o /etc/apt/keyrings/nodesource.gpg
23
+ # This can be changed to a newer supported version once tested
24
+ NODE_MAJOR=16
25
+ echo " deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR .x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
26
+ sudo apt-get update
27
+ sudo apt-get install nodejs -y
21
28
echo " --- Dependency Install Done ------"
22
29
23
30
echo " --- RPI-KVM Configuration Step ---"
@@ -54,6 +61,8 @@ sudo sed -i "s|BLUETOOTH_DAEMON_PATH|${bluetoothd_path}|" /lib/systemd/system/bl
54
61
55
62
echo " Copy RPI-KVM service config"
56
63
sudo cp ./conf/rpi-kvm.service /lib/systemd/system/rpi-kvm.service
64
+ echo " Replace legacy pi user with current user if necessary"
65
+ sudo sed -i' ' -e " s|/pi/|/${SUDO_USER} /|g" /lib/systemd/system/rpi-kvm.service
57
66
sudo systemctl daemon-reload
58
67
echo " Restart bluetooth service with the new config"
59
68
sudo systemctl restart bluetooth
0 commit comments