forked from OpenHD/OpenHD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbefore-install.sh
executable file
·40 lines (37 loc) · 1.8 KB
/
before-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
35
36
37
38
39
40
#!/usr/bin/env bash
# back it up in case the user has written valuable scripting that would be lost otherwise
if [ -f "/boot/openhd/scripts/custom_unmanaged_camera.sh" ]; then
mv /boot/openhd/scripts/custom_unmanaged_camera_old.sh /config/openhd/scripts/custom_unmanaged_camera_old.sh
fi
if [ -f "/config/openhd/scripts/custom_unmanaged_camera.sh" ]; then
mv /config/openhd/scripts/custom_unmanaged_camera_old.sh /config/openhd/scripts/custom_unmanaged_camera_old.sh
fi
# NOTE: Updating overwrites the .config file and also the service file
if [ -f "/boot/openhd/hardware.config" ]; then
rm -rf /boot/openhd/hardware.config
fi
if [ -f "/config/openhd/hardware.config" ]; then
rm -rf /config/openhd/hardware.config
fi
if [ "$(uname -m)" == "x86_64" ]; then
if ! uname -a | grep -q "azure"; then
whiptail --title "OpenHD" --yesno "You are about to install OpenHD to your Computer. Please be aware that we do not allow military usage! Do you want to continue?" 10 50
if ! [ $? -eq 0 ]; then
echo "Operation cancelled."
exit 1
else
whiptail --title "OpenHD" --yesno "Do you want to remove the old drivers?" 10 50
if [ $? -eq 0 ]; then
if whiptail --title "Confirmation" --yesno "This action will remove old drivers. Do you want to proceed?" 10 50; then
echo "Removing old drivers"
sudo dkms uninstall -m rtl8812au -v 5.2.20.2 --all || true
sudo dkms remove -m rtl8812au -v 5.2.20.2 --all || true
sudo dkms uninstall -m rtl88x2bu -v 5.13.1 --all || true
sudo dkms remove -m rtl88x2bu -v 5.13.1 --all || true
else
echo "No drivers were removed!"
fi
fi
fi
fi
fi