1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| #!/usr/bin/perl
use warnings;
use strict;
use Term::UI;
use Term::ReadLine;
use Sys::Hostname;
use Socket;
#######
my $host = hostname;
print "Hostname is : $host \n";
##### Choice for change Ip, Hostname #####
my $term = Term::ReadLine->new('prompt');
my $reponse = $term->get_reply(
prompt => 'Choice a number : ',
choices => [ 'Change HostName', 'Change Address IP', 'Exit'],
default => 'No choice',
);
print "You are choice : $reponse\n";
######## Manage Choice ########
if($choices == 1){
print "What's the hostname? "
modifier fichier hosts et hostname
open
}
else{
if($choix == 2)
{
print "What's the ip adress?"
print "What's the netmask?"
print "What's the broadcast?"
print "What's the gateway?"
modifier fichier interfaces dans /etc/network
adress =
netmask =
}
else{
if($choix == 3)
{
#Traitement cas 3
###Je dois fermer le script
}
}
} |
Partager