From 3ff62387e68f0649899b00a8b8e1a451a04ffb25 Mon Sep 17 00:00:00 2001 From: Leon Jungemeyer Date: Thu, 11 Aug 2022 10:18:56 +0200 Subject: [PATCH] Fix install script (#240) * Fix install script * Abort if no wifi adapter provided --- scripts/install_gs.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/install_gs.sh b/scripts/install_gs.sh index 0a770be0..d886f40f 100755 --- a/scripts/install_gs.sh +++ b/scripts/install_gs.sh @@ -1,11 +1,18 @@ -#!/bin/sh +#!/bin/bash set -e +if [[ $# -eq 0 ]] ; then + echo 'Please specify the name of the WiFi adapter' + echo 'Find the name using command: ifconfig' + echo 'Aborting ...' + exit 0 +fi + # Install required packages apt update apt upgrade -apt install python3-all libpcap-dev libsodium-dev python3-pip python3-pyroute2 python3-future python3-twisted +apt install python3-all libpcap-dev libsodium-dev python3-pip python3-pyroute2 python3-future python3-twisted python3-serial iw apt install virtualenv apt install debhelper apt install dh-python build-essential @@ -37,8 +44,9 @@ peer = 'connect://127.0.0.1:5600' # outgoing connection for # video sink (QGroundControl on GS) EOT +rm /etc/default/wifibroadcast cat <> /etc/default/wifibroadcast -WFB_NICS="$0" +WFB_NICS="$1" EOT cat <> /etc/NetworkManager/NetworkManager.conf