diff options
Diffstat (limited to 'ACE/bin/Uniqueid.pm')
-rw-r--r-- | ACE/bin/Uniqueid.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ACE/bin/Uniqueid.pm b/ACE/bin/Uniqueid.pm new file mode 100644 index 00000000000..f1367caa6e4 --- /dev/null +++ b/ACE/bin/Uniqueid.pm @@ -0,0 +1,28 @@ +# $Id$ +sub uniqueid +{ + if ($^O eq "MSWin32") + { + my $uid = 1; + + open (IPNUM, "ipconfig|") || die "Can't run ipconfig: $!\n"; + + while (<IPNUM>) + { + if (/Address/) + { + $uid = (split (/: (\d+)\.(\d+)\.(\d+)\.(\d+)/))[4]; + } + } + + close IPNUM; + + return $uid; + } + else + { + return getpwnam (getlogin ()); + } +} + +1;
\ No newline at end of file |