shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ajuda com script


From: Aguimar Rezende Junior
Subject: Ajuda com script
Date: Thu, 22 Jun 2017 16:20:43 -0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

Boa tarde pessoal

Sou novo nessa área de scripts, tentei fazer sozinho um script para manter ativa conexões vpn, mas não consegui. Pela urgência que tenho pergunto se alguém já tem algo pronto, vou explicar.

São diversas conexões ativas ao mesmo tempo veja o print.

ppp3: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.162.1.80 netmask 255.255.255.255 destination 192.162.1.84
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 13810  bytes 1473536 (1.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13085  bytes 5034377 (4.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp5: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.162.1.80 netmask 255.255.255.255 destination 192.162.1.86
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 5982  bytes 733854 (716.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7988  bytes 9733171 (9.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp6: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.162.1.80 netmask 255.255.255.255 destination 192.162.1.87
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 132  bytes 12880 (12.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17  bytes 4576 (4.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp7: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.162.1.80 netmask 255.255.255.255 destination 192.162.1.88
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 6778  bytes 664870 (649.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6236  bytes 1234167 (1.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp10: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 192.162.1.80 netmask 255.255.255.255 destination 192.162.1.91
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 15314  bytes 1992514 (1.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11612  bytes 2162608 (2.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


O que ocorre muitas vezes é que o usuário desliga a máquina windows sem desconectar a vpn, mas a interface fica lá ativa. Gostaria de um script que derrubasse a interface quando a mesma não estiver pingando, veja como exemplo ppp10 o ip 192.162.1.80 é o gateway do destino 192.162.1.91. Se o ip 192.162.1.80 não conseguir pingar no ip 192.162.1.91 signfica que o ip final 191 está fora de alcance ou seja micro desligado. O script no caso executaria o comando ifconfig down ppp10

Agradeço desde já


Aguimar





reply via email to

[Prev in Thread] Current Thread [Next in Thread]