Repository navigation
networklib
PhilippeLeroux edited this page Oct 9, 2018
·
5 revisions
-
networklib.sh last modified : 29/09/2018
-
Public functions
- Public function ping_test
- Public function port_open
- Public function exit_if_cannot_connect_to
- Public function right_pad_ip
- Public function convert_net_prefix_2_net_mask
- Public function get_if_hwaddr
- Public function dns_test_if_ip_exist
- Public function get_ip_for_host
- Public function remove_ip_from_known_hosts
- Public function remove_from_known_hosts
- Public function get_server_public_key
- Public function add_to_known_hosts
- Private functions
-
Public functions
- Publics functions : 12
- Undocumented functions : 0
- Privates functions : 1
$1 server to ping
return 0 if server is reachable, else other value.
$1 server name
$2 port
return 0 if port $2 open, else return 0
$1 server name
exit 1 if ssh not available on port 22 or server unreachable.
pad ip $1 with .0
Ex : 192.250.240 ==> 192.250.240.0
Convert net prefix to net mask
$1 net prefix
return net mask
Retourne l'adresse mac de l'Iface $1
Retourne 0 si l'ip $1 existe sinon 1
retourne l'IP de l'host $1, ou rien si l'IP n'est pas trouvée.
Supprime l'ip $1 du fichier ~/.ssh/know_hosts
Supprime du fichier ~/.ssh/know_host l'hôte $1
$1 server name.
return public key for server $1
Ajoute le serveur $1 au fichier ~/.ssh/known_hosts
Permet de nettoyer mon bordel.