1234567891011121314151617 |
- #!/bin/sh
- failed=0
- echo
- {% for host in ffms_tun_to%}
- ip=192.168.{{hostvars[host.host_name].domaenen_id*10 + server_id}}.{{hostvars[host.host_name].server_id*4+2}}
- ping -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.host_name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.host_name}}/$ip && failed=1;}
- ip=2a03:2260:115:ffa0:{{hostvars[host.host_name].domaenen_id}}:{{server_id}}:{{hostvars[host.host_name].server_id}}:2
- ping6 -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.host_name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.host_name}}/$ip && failed=1;}
- {% endfor %}
- echo
- {% for host in ffrl_tun %}
- ip={{ host.v4_remote | regex_replace('/.*', '') }}
- ping -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.name}}/$ip && failed=1;}
- ip={{ host.v6_remote | ipaddr('address') }}
- ping6 -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.name}}/$ip && failed=1;}
- {% endfor %}
- exit $failed
|