Skip to content

Commit 39fd850

Browse files
committed
Add support for the SDR detection option
1 parent e7525cf commit 39fd850

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

installer/installer.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
# Exit on error
2727
# set -e
2828

29-
# Enforce that this script is run as root
30-
# if [ "$(id -u)" != "0" ]; then
31-
# echo "This script must be run as root. Rerun with sudo!" 1>&2
32-
# exit 1
33-
# fi
34-
3529
### Variables
3630

3731
exec 3>&1
@@ -41,6 +35,13 @@ title="Airframes Installer ${version}"
4135

4236
### Functions: System
4337

38+
function ensureRoot() {
39+
if [ "$(id -u)" != "0" ]; then
40+
echo "This script must be run as root. Rerun with sudo!" 1>&2
41+
exit 1
42+
fi
43+
}
44+
4445
function platform() {
4546
local platform=$(uname -s)
4647
echo "$platform"
@@ -63,9 +64,9 @@ function installPlatformDependencies() {
6364
local platform=$(platform)
6465
if [ "$platform" == "Linux" ]; then
6566
apt-get update
66-
apt-get install -y git dialog
67+
apt-get install -y git dialog jq
6768
elif [ "$platform" == "Darwin" ]; then
68-
brew install git dialog
69+
brew install git dialog lsusb jq
6970
fi
7071
}
7172

@@ -146,6 +147,8 @@ function installManualAcarsdec() {
146147

147148
### Main
148149

150+
ensureRoot
151+
149152
platformSupported
150153
if [ $? -ne 0 ]; then
151154
showPlatformNotSupported
@@ -208,7 +211,13 @@ do
208211
if [ "$result" = "3" ]; then
209212
echo "Installing with packages"
210213
fi
214+
;;
211215

216+
2)
217+
source ./utils/detect-sdrs.sh
218+
sdrs=$(detectSDRs)
219+
dialog --title "Detected SDRs" --msgbox "$sdrs" 10 50
220+
sleep 5
212221

213222
esac
214223
done

0 commit comments

Comments
 (0)