-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-pi.sh
executable file
·57 lines (44 loc) · 1.65 KB
/
setup-pi.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
#!/bin/bash
#Set path to copy appimage and autolaunch location
path="/home/$USER/Desktop/Carplay.AppImage"
#create udev rule thats specific to carlinkit device
echo "Creating udev rules"
FILE=/etc/udev/rules.d/52-nodecarplay.rules
echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1314\", ATTR{idProduct}==\"152*\", MODE=\"0660\", GROUP=\"plugdev\"" | sudo tee $FILE
if [[ $? -eq 0 ]]; then
echo -e Permissions created'\n'
else
echo -e Unable to create permissions'\n'
fi
echo "checking for fuse packages"
REQUIRED_PKG="fuse"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
REQUIRED_PKG="libfuse2"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
echo "Downloading AppImage"
if getconf LONG_BIT | grep -q '64'; then
echo "64 Bit Detected"
curl -L https://github.com/rhysmorgan134/react-carplay/releases/download/v4.0.5/react-carplay-4.0.5-arm64.AppImage --output /home/$USER/Desktop/Carplay.AppImage
else
echo "32 Bit OS not supported"
exit 1
fi
echo "Download Done"
echo "Creating executable"
sudo chmod +x /home/$USER/Desktop/Carplay.AppImage
echo "Creating Autostart File"
sudo bash -c "echo '[Desktop Entry]
Name=File Manager
Exec=/home/$USER/Desktop/Carplay.AppImage
Type=Application' > /etc/xdg/autostart/carplay.desktop"
echo "All Done"