#!/usr/bin/env bash
# file: $0 - script to find useable connection on hughsnet.
let CONNECT=0
while [ $CONNECT -lt 1 ]; do
sudo -H dhcpcd -k 2>&1 >/dev/null
sudo -H dhcpcd
ST=$( ping -c 5 8.8.8.8|tail -2 )
if [ $ST !='connect: Network is unreachable' ]; then
CONNECT=CONNECT+1
fi
done
The ST variable doesn't capture the search string the if statement is
needing to find. Putting parentheses around a command appears only to
capture output of a command and send it to stdout or stderr. In case of
bad network connections this script first kills dhcp then reconnects. If
successful it need only happen once.
--
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list