I am trying real hard to figure out how to fix my for loop in my bash profile. So here is my problem, I have an alias command called "command" it works.
For the sake of brevity we will say alias command='teamviewer'
So I am trying to make the bash profile go through a for-loop to detect internet connectivity. I was able to awk my way to success to determine when the state is up and when the state is down. Not I am stuck on my for-loop and am having issues making it work. The for-loop is as follows
#For-loop begins below
# Variable Assignment and Alias Command for Network Connectivity
# ==============================================================
alias command='teamviewer'
alias inet_state="ip addr show | awk '{print $8,$9}' | awk 'NR >= 7 && NR <=7'"
inetstate-good='$(state UP)'
inetstate-bad='$(state DOWN)'
# Loop for Internet Connection & Start Broadsign
# ==============================================
echo "$(inet_state);
for inet_state in "$(inet_state);
do {
if inet_state="$(inetstate-bad)";
then 'sleep 9999999999';
elif inet_state="$(inetstate-good)";
command;
fi}
done
# ==============================================
Anyhelp would be greatly appreciated :D