mirror of https://github.com/OpenIPC/firmware.git
[no ci] Datalink: reduce script verbosity
parent
32303b058e
commit
19d668098c
|
@ -12,9 +12,7 @@ fi
|
||||||
|
|
||||||
if [ ! -f /usr/bin/telemetry_rx ] && [ ! -f /usr/bin/telemetry_tx ]; then
|
if [ ! -f /usr/bin/telemetry_rx ] && [ ! -f /usr/bin/telemetry_tx ]; then
|
||||||
ln -s /usr/bin/wfb_rx /usr/bin/telemetry_rx
|
ln -s /usr/bin/wfb_rx /usr/bin/telemetry_rx
|
||||||
chmod +x /usr/bin/telemetry_rx
|
|
||||||
ln -s /usr/bin/wfb_tx /usr/bin/telemetry_tx
|
ln -s /usr/bin/wfb_tx /usr/bin/telemetry_tx
|
||||||
chmod +x /usr/bin/telemetry_tx
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
start_drone_telemetry() {
|
start_drone_telemetry() {
|
||||||
|
@ -47,7 +45,6 @@ case "$1" in
|
||||||
if [ "$fw" = "fpv" ] || [ "$fw" = "venc" ]; then
|
if [ "$fw" = "fpv" ] || [ "$fw" = "venc" ]; then
|
||||||
start_${unit}_telemetry
|
start_${unit}_telemetry
|
||||||
fi
|
fi
|
||||||
echo "Done."
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
|
|
@ -110,7 +110,6 @@ streamer() {
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
# complete tweaks and add flag
|
# complete tweaks and add flag
|
||||||
fw_setenv wlandev
|
|
||||||
touch /etc/system.ok
|
touch /etc/system.ok
|
||||||
echo "Restart system to apply fpv changes..."
|
echo "Restart system to apply fpv changes..."
|
||||||
reboot
|
reboot
|
||||||
|
|
|
@ -30,11 +30,7 @@ set_mcs() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# "0bda:8813" -> (8814) -> 8814au
|
|
||||||
# "0846:9052" -> (8811) -> 8821au
|
|
||||||
|
|
||||||
detect_wifi_card() {
|
detect_wifi_card() {
|
||||||
echo "Detecting wifi card vendor..."
|
|
||||||
devices=$(lsusb | cut -d ' ' -f6 | sort | uniq)
|
devices=$(lsusb | cut -d ' ' -f6 | sort | uniq)
|
||||||
for card in $devices; do
|
for card in $devices; do
|
||||||
case "$card" in
|
case "$card" in
|
||||||
|
@ -56,18 +52,16 @@ detect_wifi_card() {
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$driver" ]; then
|
if [ -z "$driver" ]; then
|
||||||
echo "No usb wifi card detected. Check wifi stick connection, usb power or possible bad soldering."
|
echo "Wireless module not detected, check the usb connection."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Detected: $driver"
|
echo "Detected: $driver"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Awaiting interface $wlan in system..."
|
|
||||||
|
|
||||||
local n=0
|
local n=0
|
||||||
while ! ifconfig -a | grep -q "$wlan"; do
|
while ! ifconfig -a | grep -q "$wlan"; do
|
||||||
if [ "$n" -ge 5 ]; then
|
if [ "$n" -ge 5 ]; then
|
||||||
echo "No interface $wlan. Check wifi stick connection, usb power or possible bad soldering."
|
echo "No interface for $wlan, check the usb connection."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
@ -116,20 +110,15 @@ case "$1" in
|
||||||
if [ "$daemon" -eq 1 ]; then
|
if [ "$daemon" -eq 1 ]; then
|
||||||
echo "Loading modules and wifi card driver..."
|
echo "Loading modules and wifi card driver..."
|
||||||
load_modules
|
load_modules
|
||||||
|
|
||||||
echo "Preparing interface wlan..."
|
|
||||||
load_interface
|
load_interface
|
||||||
|
|
||||||
if ! cat "$keydir/$unit.key" > /dev/null 2>&1; then
|
if ! cat "$keydir/$unit.key" > /dev/null 2>&1; then
|
||||||
echo "Generating drone & ground station keys..."
|
echo "Generating drone & ground station keys..."
|
||||||
cd $keydir && wfb_keygen
|
cd $keydir && wfb_keygen
|
||||||
else
|
|
||||||
echo "$unit key exist..."
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting Wifibroadcast service..."
|
echo "Starting Wifibroadcast service..."
|
||||||
start_"$unit"_wfb
|
start_"$unit"_wfb
|
||||||
echo "Done."
|
|
||||||
|
|
||||||
if [ "$telemetry" = "true" ]; then
|
if [ "$telemetry" = "true" ]; then
|
||||||
if [ "$chip" = "gk7205v200" ]; then
|
if [ "$chip" = "gk7205v200" ]; then
|
||||||
|
@ -142,7 +131,7 @@ case "$1" in
|
||||||
telemetry start
|
telemetry start
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Wifibroadcast service disabled in wfb.conf..."
|
echo "Wifibroadcast service disabled in wfb.conf."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue