Skip to content

Commit

Permalink
2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertWojtowicz committed Dec 22, 2024
1 parent 7e6a7d0 commit e70e5f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions import_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ echo -e "=============================================\n"
timenow() {
date +%d.%m.%Y-%H:%M:%S
}
path=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
source <(grep switch_ $path/user/export2garmin.cfg)
remove_lock() {
rm -f "$switch_temp_path/export.lock"
Expand All @@ -29,22 +30,21 @@ while [[ $loop_count -eq 0 ]] || [[ $i -lt $loop_count ]] ; do
((i++))

# Restart WiFi if it crashed (problem with Raspberry Pi 5)
path=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
if [[ $switch_wifi_watchdog == "on" ]] ; then
if nmcli -t -f WIFI g | grep -q "enabled" && nmcli -t -f ACTIVE dev wifi | grep -q "^yes" ; then
echo "$(timenow) SYSTEM * WiFi adapter working, go to verify BLE adapter"
else
else
echo "$(timenow) SYSTEM * WiFi adapter not working, restarting via nmcli"
sudo nmcli radio wifi off
sleep 1
sudo nmcli radio wifi on
fi
fi

# Print location of variables for temp and user files
echo "$(timenow) SYSTEM * Path to temp files: $switch_temp_path/"
echo "$(timenow) SYSTEM * Path to user files: $path/user/"

# Verifying correct working of BLE, restart bluetooth service and device via miscale_ble.py
if [[ $switch_miscale == "on" && $switch_mqtt == "off" ]] || [[ $switch_omron == "on" ]] ; then
unset $(compgen -v | grep '^ble_')
Expand Down

0 comments on commit e70e5f3

Please sign in to comment.