Commit edc84c89 by Feanil Patel

Fixed bugs found in further testing.

The cron-job was not thoroughly tested before but has been now.
parent aa39a5ad
......@@ -1721,7 +1721,7 @@
"ln -sf ec2-api-tools-* ec2-api-tools\n",
"cat <<'EOF' > /opt/edx/bin/nat_monitor.sh\n",
"#!/bin/sh\n",
"#!/bin/bash\n",
"# This script will monitor another NAT instance and take over its routes\n",
"# if communication with the other instance fails\n",
"\n",
......@@ -1809,7 +1809,7 @@
" sleep $Wait_for_Instance_Stop\n",
" fi\n",
" unhealthy_nat_pingresult=`ping -c $Num_Pings -W $Ping_Timeout $PRIMARY_NAT_IP| grep time= | wc -l`\n",
" if [ \"$unhealthy_nat_pingresult\" != \"$Num_Pings\" ]; then\n",
" if [ \"$unhealthy_nat_pingresult\" == \"$Num_Pings\" ]; then\n",
" NAT_HEALTHY=1\n",
" fi\n",
" done\n",
......@@ -1832,7 +1832,7 @@
"done\n",
"EOF\n",
"chmod u+x /opt/edx/bin/nat_monitor.sh\n",
"echo '@reboot /root/nat_monitor.sh > /var/log/nat_monitor.log' | crontab\n",
"echo '@reboot /opt/edx/bin/nat_monitor.sh > /var/log/nat_monitor.log' | crontab\n",
"/opt/edx/bin/nat_monitor.sh > /var/log/nat_monitor.log &\n"
]]}}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment