> +      gps.programPath = "/bin/sh";
> +
> +      StringBuilder ethScript = new StringBuilder();
> +
> +      ethScript.append("\necho \\\"#!/bin/bash\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"c=1\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"while [ \\\\\\$c -le 12 ]; do\\\" >> 
> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"[ -f /etc/resolv.conf ] && break\\\" >> 
> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"(( c++ ))\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"sleep 5\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"done\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\necho \\\"[ -f /etc/resolv.conf ] && grep 
> nameserver /etc/resolv.conf | awk '{ if(length(\\\\\\$2) > 0) 
> system(\\\\\\\"ping -c 4 \\\\\\\" \\\\\\$2); }' > /tmp/ping-results.log 
> 2>&1\\\" >> /tmp/ping_dns.sh;");
> +      ethScript.append("\nchmod +x /tmp/ping_dns.sh;");
> +      ethScript.append("\n/tmp/ping_dns.sh;");
> +      ethScript.append("\nmkdir -p ~/.ssh;");
> +      ethScript.append("\nrestorecon -FRvv ~/.ssh;");

Move all this to a resource file int he classpath.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/61/files#r18062097

Reply via email to