New to bash here. Trying to write a while loop that checks for 3 conditions, 2 user input and if a ping command failed. How to combine all 3 into 1 big statement? Would like to check that user didn't enter Y or y or ping to google.com failed
attempt:
# Ask user to confirm ethernet cable connected or quit with Yy or Qq in continous loop.
echo -e "Connect ethernet cable to Pi Slave. Type (Y) when done, (Q) to quit:"
read confirm
# If confirm is Y or y, continue to rest of script
while [[ "$confirm" != "Y" && "$confirm" != "y" && ping -q -c 1 -w 1 google.com ]]
do
if [[ "$confirm" == "Q" || "$confirm" == "q" ]]; then
exit 1
fi
echo -e "Connect ethernet cable to Pi Master. Type (Y) when done, (Q) to quit:"
read confirm
done