-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
34 lines (30 loc) · 845 Bytes
/
install.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
#!/bin/sh
# Mount filesystem as R/W
/bin/mount -uw /mnt/app
/bin/mount -uw /mnt/system
# Copy binary from sd card 0 to main unit
echo "Copying VNC binary."
cp /fs/sda0/opengl-render-qnx /navigation/opengl-render-qnx
echo "Modifying startup.sh"
# Name of the file to modify
FILE="/etc/boot/startup.sh"
# Check if the block of code is already present
if ! grep -qF "# QNX VNC CLIENT" "$FILE"; then
# If not, append it after the specified section
sed -i '/# DCIVIDEO: Kombi Map/ {
N
N
N
N
a \
# QNX VNC CLIENT \
if [ -f /navigation/opengl-render-qnx ]; then \
chmod 0777 /navigation/opengl-render-qnx \
/navigation/opengl-render-qnx & \
else \
echo "File /navigation/opengl-render-qnx does not exist." \
fi
}' "$FILE"
else
echo "Block already present. Replacement skipped."
fi