forked from alhazred/solaris-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPtoHex.pl
58 lines (47 loc) · 1.39 KB
/
IPtoHex.pl
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 -w
###
# IPtoHex
#
# Convert IP address to Hex-format.
# Very useful when creating jumpstart-server for Solaris
# where the tftp inetboot image has to be linked to IP address
# in Hex format.
#
# Script is run in hand.
#
# Programmed by: Yngve Berthelsen
# Date: 20061025
# E-Mail: [email protected]
#
# Last updated: 20061025
#
# History:
### Variables used in script
if(! $ARGV[0])
{
printf("Convert IP adresses to Hexadecimal format\n");
printf("Programmed by Yngve Berthelsen\n\n");
printf("Usage: IPtoHex <IP adresse>\n");
printf("Example: IPtoHex 127.0.0.1\n");
exit 0;
}
else
{
printf("Convert IP adresses to Hexadecimal format\n");
printf("Programmed by Yngve Berthelsen\n\n");
@IP = split(/\./, $ARGV[0]);
printf("IP address %s, converts to Hex: %02X%02X%02X%02X\n",$ARGV[0],$IP[0],$IP[1],$IP[2],$IP[3]);
}
# Exit
exit 0;
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2008 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################