Changeset 348 for trunk


Ignore:
Timestamp:
Sep 3, 2018, 11:36:54 AM (6 years ago)
Author:
g7moreau
Message:
  • Better doc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r347 r348  
    2121use strict;
    2222#use warnings;
    23 use version; our $VERSION = version->declare('0.11.2');
     23use version; our $VERSION = version->declare('0.11.3');
    2424
    2525use Getopt::Long qw(GetOptions);
     
    473473#Nom: add_dhcp
    474474#Description: section à corriger pour prendre en compte l'ajout d'une machine dans un pool dhcp
    475 #--- usage: ddt add_dhcp -d legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165
     475#--- usage: ddt add-dhcp -s legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165
    476476
    477477sub add_dhcp {
     
    505505
    506506#-------------------------------------------------------------------------------
    507 #--- usage: ddt add_float -d legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165
     507#--- usage: ddt add-float -s legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165
    508508
    509509sub add_float {
     
    700700#Description: change la mac adresse d'une machine en saisissant soit l'ip
    701701#             soit le nom de la mahcine et spécifiant le domaine
    702 #--- usage: ddt change_mac -d legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66
    703 #--- usage: ddt change_mac -d legi-sector03 -i 194.254.66.187 -m 00:18:F3:03:6F:66
     702#--- usage: ddt change-mac -s legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66
     703#--- usage: ddt change-mac -s legi-sector03 -i 194.254.66.187 -m 00:18:F3:03:6F:66
    704704
    705705sub change_mac {
     
    28962896   if ($command eq 'add-dhcp') {
    28972897      print "List of options for command: $command\n";
    2898       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     2898      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    28992899      print " -h : computer hostname (mandatory if option -i != 'pool'). Example: -h info8pc154\n";
    29002900      print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A\n";
     
    29032903      print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n";
    29042904      print "Example:\n";
    2905       print " ddt add_dhcp -h most1mc130 -d legi-661 -i 194.254.66.130 -m 00:17:F2:D3:2B:FF -c '2008-07-03 Mac Book Guillaume Balleyrac (MOST)\n";
    2906       print " ddt add_dhcp -p pool-stagiaire -i pool -d hmg.priv -m 02:00:54:55:4E:01 -c '2008-09-02 Portable Perso - Laanaia Nabil - Achim Wirth (MEIGE)\n";
     2905      print " ddt add-dhcp -h most1mc130 -s legi-sector03 -i 194.254.66.130 -m 00:17:F2:D3:2B:FF -c '2008-07-03 Mac Book Guillaume Balleyrac (MOST)\n";
    29072906      }
    29082907
    29092908   elsif ($command eq 'add-float') {
    29102909      print "List of options for command: $command\n";
    2911       print " -d : sector attachment (mandatory)\n";
     2910      print " -s : sector attachment (mandatory)\n";
    29122911      print " -p : name of the DHCP pool to which the machine belongs (mandatory)\n";
    29132912      print " -m : physical MAC address (mandatory)\n";
    29142913      print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n";
    29152914      print "Example:\n";
    2916       print " ddt add_float -p pool-stagiaire -d hmg.priv -i 192.168.10.1 -m 00:AB:1B:CC:AA:2F -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
     2915      print " ddt add-float -p pool-stagiaire -s legi-pool -i 192.168.10.1 -m 00:AB:1B:CC:AA:2F -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
    29172916      }
    29182917
    29192918   elsif ($command eq 'add-static') {
    29202919      print "List of options for command: $command\n";
    2921       print " -d : sector attachment (mandatory)\n";
     2920      print " -s : sector attachment (mandatory)\n";
    29222921      print " -i : internet IP address (mandatory)\n";
    29232922      print " -h : computer hostname (mandatory)\n";
     
    29252924      print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n";
    29262925      print "Example:\n";
    2927       print " ddt add_static -h legipc1 -d hmg.priv -i 192.168.10.1 -m 00:AB:1B:CC:AA:2F -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
     2926      print " ddt add-static -h legipc1 -s legi-sector03 -i 192.168.10.1 -m 00:AB:1B:CC:AA:2F -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
    29282927      }
    29292928
    29302929   elsif ($command eq 'add-virtual') {
    29312930      print "List of options for command: $command\n";
    2932       print " -d : sector attachment (mandatory)\n";
     2931      print " -s : sector attachment (mandatory)\n";
    29332932      print " -i : internet IP address (mandatory)\n";
    29342933      print " -h : computer hostname (mandatory)\n";
    29352934      print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n";
    29362935      print "Example:\n";
    2937       print " ddt add_virtual -h legipc1 -d legi-211 -i 192.168.10.1 -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
     2936      print " ddt add-virtual -h legipc1 -s legi-sector03 -i 192.168.10.1 -c '2013-09-25 Dell OptiPlex 745 - Eric Goncalves (NRJ)\n";
    29382937      }
    29392938
    29402939   elsif ($command eq 'add-alias') {
    29412940      print "List of options for command: $command\n";
    2942       print " -d : sector attachment (mandatory)\n";
     2941      print " -s : sector attachment (mandatory)\n";
    29432942      print " -h : computer hostname (mandatory)\n";
    29442943      print " -a : computer alias name (mandatory)\n";
     
    29472946   elsif ($command eq 'create-sector') {
    29482947      print "List of options for command: $command\n";
    2949       print " -d : new sector (mandatory)\n";
     2948      print " -s : new sector (mandatory)\n";
    29502949      print " -e : DNS domain name extension( mandatory). Example legi.grenoble-inp.fr\n";
    29512950      print " -c : comment (mandatory). Example: 2016-08-22 VLAN legi-261 (INFO)\n";
    29522951      print "Examples:\n";
    2953       print " ddt create_sector -d legi-264 -e legi.grenoble-inp.fr -c '2016-08-22 VLAN legi-261 (INFO)'\n";
     2952      print " ddt create-sector -s legi-sector03 -e legi.grenoble-inp.fr -c '2016-08-22 VLAN legi-261 (INFO)'\n";
    29542953      }
    29552954
     
    29572956      print "List of options for command: $command\n";
    29582957      print " -p : name of the DHCP pool. Example: pool-legi-priv\n";
    2959       print " -d : sector attachment for the pool. (sector attachment must exist in file $COMPUTER_BASENAME.conf). Example: legi.grenoble-inp.fr\n";
     2958      print " -s : sector attachment for the pool. (sector attachment must exist in file $COMPUTER_BASENAME.conf). Example: legi-sector03\n";
    29602959      print " -f : configuration filename on the DHCP server for the pool\n";
    29612960      print " -i : adresse(s) IP ou plage d'IP. Séparateur d'adresses IP: ','. Séparateur de plage '-'\n";
    29622961      print "Examples:\n";
    2963       print " ddt -p pool-hmg -d hmg.priv -f pool.hmg.priv -i 192.168.10.1,192.168.10.2,192.168.10.3\n";
    2964       print " ddt -p turbocavit -d legi-sector03 -f pool-legi-public -i 192.168.10.1-192.168.10.4\n";
     2962      print " ddt create-pool -p legi-pool1 -s legi-sector03 -f legi-pool-private -i 192.168.10.1,192.168.10.2,192.168.10.3\n";
     2963      print " ddt create-pool -p legi-pool2 -s legi-sector03 -f legi-pool-public -i 192.168.10.1-192.168.10.4\n";
    29652964      }
    29662965
     
    29822981      print " -h : computer hostname (mandatory unless option -i)\n";
    29832982      print " -i : internet IP address (mandatory unless option -h)\n";
    2984       print " -d : sector attachment (mandatory if option -h)\n";
     2983      print " -s : sector attachment (mandatory if option -h)\n";
    29852984      print " -b : name of the PXE/BOOTP configuration. Example: most\n";
    29862985      }
     
    29902989      print " -h : computer hostname (mandatory unless option -i)\n";
    29912990      print " -i : internet IP address (mandatory unless option -h)\n";
    2992       print " -d : sector attachment (mandatory if option -h)\n";
     2991      print " -s : sector attachment (mandatory if option -h)\n";
    29932992      }
    29942993
     
    30073006   elsif ($command eq 'change-mac') {
    30083007      print "List of options for command: $command\n";
    3009       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     3008      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    30103009      print " -h : computer hostname (mandatory unless option -i)\n";
    30113010      print " -i : internet IP address (mandatory unless option -h). Possible value: classical IP address or the keyword 'pool'\n";
     
    30153014   elsif ($command eq 'change-ip') {
    30163015      print "List of options for command: $command\n";
    3017       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     3016      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    30183017      print " -h : computer hostname (mandatory)\n";
    30193018      print " -i : new internet IP address (mandatory). Possible value: classical IP address\n";
     
    30223021   elsif ($command eq 'change-host') {
    30233022      print "List of options for command: $command\n";
    3024       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     3023      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    30253024      print " -i : internet IP address (mandatory). Possible value: classical IP address\n";
    30263025      print " -h : new computer hostname (mandatory)\n";
     
    30303029   elsif ($command eq 'change-comment') {
    30313030      print "List of options for command: $command\n";
    3032       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     3031      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    30333032      print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A:22:11\n";
    30343033      print " -c : new comment (mandatory)\n";
     
    30373036   elsif ($command eq 'change-sector') {
    30383037      print "List of options for command: $command\n";
    3039       print " -d : new sector attachment (mandatory). Example: -d legi-661\n";
     3038      print " -s : new sector attachment (mandatory). Example: -s legi-sector03\n";
    30403039      print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A:22:11\n";
    30413040      print " -i : internet IP address (mandatory)\n";
     
    30453044      print "List of options for command: $command\n";
    30463045      print " -h : computer hostname (mandatory unless option -i or -m)\n";
    3047       print " -d : sector attachment (mandatory). Example: -d legi-sector03\n";
     3046      print " -s : sector attachment (mandatory). Example: -s legi-sector03\n";
    30483047      print " -i : internet IP address (mandatory unless option -h or -m)\n";
    30493048      print " -m : physical MAC address (mandatory unless option -h or -i, priority). Example: -m 0F:58:AB:2A:22:11\n";
     
    30533052   elsif ($command eq 'load-database') {
    30543053      print "List of options for command: $command\n";
    3055       print " -d : sector attachment\n";
     3054      print " -s : sector attachment\n";
    30563055      print " -f : input file in DHCP format\n";
    30573056      print " -k : possible cases (kind): dhcp, pool-dhcp, fix-address\n";
     
    30623061      print " -h : computer hostname (mandatory unless option -i)\n";
    30633062      print " -i : internet IP address (mandatory unless option -h)\n";
    3064       print " -d : sector attachment (mandatory if option -h)\n";
     3063      print " -s : sector attachment (mandatory if option -h)\n";
    30653064      print "Examples:\n";
    3066       print " ddt enable_pc -i 192.168.10.1\n";
    3067       print " ddt enable_pc -d hmg.priv -h kevinpc\n";
     3065      print " ddt enable-pc -i 192.168.10.1\n";
     3066      print " ddt enable-pc -s legi-sector03 -h kevinpc\n";
    30683067      }
    30693068
     
    30843083      print " -h : computer hostname (mandatory unless option -i)\n";
    30853084      print " -i : internet IP address (mandatory unless option -h)\n";
    3086       print " -d : sector attachment (mandatory if option -h)\n";
     3085      print " -s : sector attachment (mandatory if option -h)\n";
    30873086      print "Examples:\n";
    3088       print " ddt disable_pc -i 192.168.10.1\n";
    3089       print " ddt disable_pc -d hmg.priv -h kevinpc\n";
     3087      print " ddt disable-pc -i 192.168.10.1\n";
     3088      print " ddt disable-pc -s legi-sector03 -h kevinpc\n";
    30903089      }
    30913090
    30923091   elsif ($command eq 'del-pc') {
    30933092      print "List of options for command: $command\n";
    3094       print " -d : sector attachment (mandatory)\n";
     3093      print " -s : sector attachment (mandatory)\n";
    30953094      print " -h : computer hostname (mandatory unless option -i)\n";
    30963095      print " -i : internet IP address (mandatory unless option -h)\n";
Note: See TracChangeset for help on using the changeset viewer.