From 21b2f6cf5bc694ad559c74f407ab76942c93fe4e Mon Sep 17 00:00:00 2001 From: Werner Date: Wed, 1 Jan 2020 20:48:40 +0100 Subject: [PATCH] Script does not properly stop on network issue (#1706) Fixes https://forum.armbian.com/topic/12579-opi-stuck-after-restart-cant-connect-to-network/ --- packages/bsp/common/usr/bin/armbianmonitor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bsp/common/usr/bin/armbianmonitor b/packages/bsp/common/usr/bin/armbianmonitor index 7731c0f0aa..a490fd3f85 100755 --- a/packages/bsp/common/usr/bin/armbianmonitor +++ b/packages/bsp/common/usr/bin/armbianmonitor @@ -147,8 +147,11 @@ ParseOptions() { ;; u) # Upload /var/log/armbian-hardware-monitor.log with additional support info - fping ix.io 2>/dev/null | grep -q alive || \ - (echo -e "\nNetwork/firewall problem detected. Not able to upload debug info.\nPlease fix this or use \"-U\" instead and upload ${BOLD}whole output${NC} manually\n" >&2 ; exit 1) + fping ix.io 2>/dev/null | grep -q alive + if [ $? != 0 ]; then + echo -e "\nNetwork/firewall problem detected. Not able to upload debug info.\nPlease fix this or use \"-U\" instead and upload ${BOLD}whole output${NC} manually\n" >&2 + exit 1 + fi which curl >/dev/null 2>&1 || apt-get -f -qq -y install curl echo -e "System diagnosis information will now be uploaded to \c" # we obfuscate IPv4 addresses somehow but not too much, MAC addresses have to remain