- Timestamp:
- Sep 3, 2018, 11:36:54 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r347 r348 21 21 use strict; 22 22 #use warnings; 23 use version; our $VERSION = version->declare('0.11. 2');23 use version; our $VERSION = version->declare('0.11.3'); 24 24 25 25 use Getopt::Long qw(GetOptions); … … 473 473 #Nom: add_dhcp 474 474 #Description: section à corriger pour prendre en compte l'ajout d'une machine dans un pool dhcp 475 #--- usage: ddt add _dhcp -dlegi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165475 #--- usage: ddt add-dhcp -s legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165 476 476 477 477 sub add_dhcp { … … 505 505 506 506 #------------------------------------------------------------------------------- 507 #--- usage: ddt add _float -dlegi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165507 #--- usage: ddt add-float -s legi-sector03 -h meolpacif -m 00:18:F3:03:6F:66 -i 194.254.66.165 508 508 509 509 sub add_float { … … 700 700 #Description: change la mac adresse d'une machine en saisissant soit l'ip 701 701 # soit le nom de la mahcine et spécifiant le domaine 702 #--- usage: ddt change _mac -dlegi-sector03 -h meolpacif -m 00:18:F3:03:6F:66703 #--- usage: ddt change _mac -dlegi-sector03 -i 194.254.66.187 -m 00:18:F3:03:6F:66702 #--- 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 704 704 705 705 sub change_mac { … … 2896 2896 if ($command eq 'add-dhcp') { 2897 2897 print "List of options for command: $command\n"; 2898 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";2898 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 2899 2899 print " -h : computer hostname (mandatory if option -i != 'pool'). Example: -h info8pc154\n"; 2900 2900 print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A\n"; … … 2903 2903 print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n"; 2904 2904 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"; 2907 2906 } 2908 2907 2909 2908 elsif ($command eq 'add-float') { 2910 2909 print "List of options for command: $command\n"; 2911 print " - d: sector attachment (mandatory)\n";2910 print " -s : sector attachment (mandatory)\n"; 2912 2911 print " -p : name of the DHCP pool to which the machine belongs (mandatory)\n"; 2913 2912 print " -m : physical MAC address (mandatory)\n"; 2914 2913 print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n"; 2915 2914 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"; 2917 2916 } 2918 2917 2919 2918 elsif ($command eq 'add-static') { 2920 2919 print "List of options for command: $command\n"; 2921 print " - d: sector attachment (mandatory)\n";2920 print " -s : sector attachment (mandatory)\n"; 2922 2921 print " -i : internet IP address (mandatory)\n"; 2923 2922 print " -h : computer hostname (mandatory)\n"; … … 2925 2924 print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n"; 2926 2925 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"; 2928 2927 } 2929 2928 2930 2929 elsif ($command eq 'add-virtual') { 2931 2930 print "List of options for command: $command\n"; 2932 print " - d: sector attachment (mandatory)\n";2931 print " -s : sector attachment (mandatory)\n"; 2933 2932 print " -i : internet IP address (mandatory)\n"; 2934 2933 print " -h : computer hostname (mandatory)\n"; 2935 2934 print " -c : comment (mandatory). Example: 2014-04-07 DELL Laptop 6400 - Olivier Toto (INFO)\n"; 2936 2935 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"; 2938 2937 } 2939 2938 2940 2939 elsif ($command eq 'add-alias') { 2941 2940 print "List of options for command: $command\n"; 2942 print " - d: sector attachment (mandatory)\n";2941 print " -s : sector attachment (mandatory)\n"; 2943 2942 print " -h : computer hostname (mandatory)\n"; 2944 2943 print " -a : computer alias name (mandatory)\n"; … … 2947 2946 elsif ($command eq 'create-sector') { 2948 2947 print "List of options for command: $command\n"; 2949 print " - d: new sector (mandatory)\n";2948 print " -s : new sector (mandatory)\n"; 2950 2949 print " -e : DNS domain name extension( mandatory). Example legi.grenoble-inp.fr\n"; 2951 2950 print " -c : comment (mandatory). Example: 2016-08-22 VLAN legi-261 (INFO)\n"; 2952 2951 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"; 2954 2953 } 2955 2954 … … 2957 2956 print "List of options for command: $command\n"; 2958 2957 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"; 2960 2959 print " -f : configuration filename on the DHCP server for the pool\n"; 2961 2960 print " -i : adresse(s) IP ou plage d'IP. Séparateur d'adresses IP: ','. Séparateur de plage '-'\n"; 2962 2961 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"; 2965 2964 } 2966 2965 … … 2982 2981 print " -h : computer hostname (mandatory unless option -i)\n"; 2983 2982 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"; 2985 2984 print " -b : name of the PXE/BOOTP configuration. Example: most\n"; 2986 2985 } … … 2990 2989 print " -h : computer hostname (mandatory unless option -i)\n"; 2991 2990 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"; 2993 2992 } 2994 2993 … … 3007 3006 elsif ($command eq 'change-mac') { 3008 3007 print "List of options for command: $command\n"; 3009 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";3008 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 3010 3009 print " -h : computer hostname (mandatory unless option -i)\n"; 3011 3010 print " -i : internet IP address (mandatory unless option -h). Possible value: classical IP address or the keyword 'pool'\n"; … … 3015 3014 elsif ($command eq 'change-ip') { 3016 3015 print "List of options for command: $command\n"; 3017 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";3016 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 3018 3017 print " -h : computer hostname (mandatory)\n"; 3019 3018 print " -i : new internet IP address (mandatory). Possible value: classical IP address\n"; … … 3022 3021 elsif ($command eq 'change-host') { 3023 3022 print "List of options for command: $command\n"; 3024 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";3023 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 3025 3024 print " -i : internet IP address (mandatory). Possible value: classical IP address\n"; 3026 3025 print " -h : new computer hostname (mandatory)\n"; … … 3030 3029 elsif ($command eq 'change-comment') { 3031 3030 print "List of options for command: $command\n"; 3032 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";3031 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 3033 3032 print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A:22:11\n"; 3034 3033 print " -c : new comment (mandatory)\n"; … … 3037 3036 elsif ($command eq 'change-sector') { 3038 3037 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"; 3040 3039 print " -m : physical MAC address (mandatory). Example: -m 0F:58:AB:2A:22:11\n"; 3041 3040 print " -i : internet IP address (mandatory)\n"; … … 3045 3044 print "List of options for command: $command\n"; 3046 3045 print " -h : computer hostname (mandatory unless option -i or -m)\n"; 3047 print " - d : sector attachment (mandatory). Example: -dlegi-sector03\n";3046 print " -s : sector attachment (mandatory). Example: -s legi-sector03\n"; 3048 3047 print " -i : internet IP address (mandatory unless option -h or -m)\n"; 3049 3048 print " -m : physical MAC address (mandatory unless option -h or -i, priority). Example: -m 0F:58:AB:2A:22:11\n"; … … 3053 3052 elsif ($command eq 'load-database') { 3054 3053 print "List of options for command: $command\n"; 3055 print " - d: sector attachment\n";3054 print " -s : sector attachment\n"; 3056 3055 print " -f : input file in DHCP format\n"; 3057 3056 print " -k : possible cases (kind): dhcp, pool-dhcp, fix-address\n"; … … 3062 3061 print " -h : computer hostname (mandatory unless option -i)\n"; 3063 3062 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"; 3065 3064 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"; 3068 3067 } 3069 3068 … … 3084 3083 print " -h : computer hostname (mandatory unless option -i)\n"; 3085 3084 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"; 3087 3086 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"; 3090 3089 } 3091 3090 3092 3091 elsif ($command eq 'del-pc') { 3093 3092 print "List of options for command: $command\n"; 3094 print " - d: sector attachment (mandatory)\n";3093 print " -s : sector attachment (mandatory)\n"; 3095 3094 print " -h : computer hostname (mandatory unless option -i)\n"; 3096 3095 print " -i : internet IP address (mandatory unless option -h)\n";
Note: See TracChangeset
for help on using the changeset viewer.