forked from OpenHD/OpenHD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbefore-install.sh
executable file
·63 lines (59 loc) · 2.77 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
################################################################################
# OpenHD
#
# Licensed under the GNU General Public License (GPL) Version 3.
#
# This software is provided "as-is," without warranty of any kind, express or
# implied, including but not limited to the warranties of merchantability,
# fitness for a particular purpose, and non-infringement. For details, see the
# full license in the LICENSE file provided with this source code.
#
# Non-Military Use Only:
# This software and its associated components are explicitly intended for
# civilian and non-military purposes. Use in any military or defense
# applications is strictly prohibited unless explicitly and individually
# licensed otherwise by the OpenHD Team.
#
# Contributors:
# A full list of contributors can be found at the OpenHD GitHub repository:
# https://github.com/OpenHD
#
# © OpenHD, All Rights Reserved.
################################################################################
# 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