summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-20 22:25:25 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-20 22:25:25 +0000
commit67e3057e3e4a4ea4c57e53d5cee70726122fbd59 (patch)
tree9494c5492212dc0024d11da4d1bf1c2088ce06ba /bin
parent55dbacd5bc5418f4a95458369860e5d0ba2ca3b9 (diff)
downloadATCD-67e3057e3e4a4ea4c57e53d5cee70726122fbd59.tar.gz
Common functionality for perl files
Diffstat (limited to 'bin')
-rw-r--r--bin/Uniqueid.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/Uniqueid.pm b/bin/Uniqueid.pm
new file mode 100644
index 00000000000..f1367caa6e4
--- /dev/null
+++ b/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