]> arthur.barton.de Git - netatalk.git/commitdiff
Added "nu" to contrib (netatalk users script)
authorrufustfirefly <rufustfirefly>
Fri, 4 Aug 2000 15:56:31 +0000 (15:56 +0000)
committerrufustfirefly <rufustfirefly>
Fri, 4 Aug 2000 15:56:31 +0000 (15:56 +0000)
Makefile.am
configure.in
contrib/Makefile.am
contrib/nu/Makefile.am [new file with mode: 0644]
contrib/nu/nu [new file with mode: 0755]

index 0c8fa1e11c9cd051316359e40c5f3e5d6c26a7c7..f5999c2207a195c11abe03188fa4fa90e2665d04 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am for top level of netatalk package
 
-SUBDIRS = libatalk bin config etc man
-# these later : contrib distrib include
+SUBDIRS = libatalk bin config etc man contrib
+# these later : distrib include
 
 EXTRA_DIST = BUGS CHANGES CONTRIBUTORS COPYRIGHT ChangeLog README README.ASUN TODO VERSION services.atalk
 
index d28d1c0a89d15b64a6219affa14789e2c4d19feb..3e76683c9ff5626522fdb5c551a3ce13042ed2cf 100644 (file)
@@ -224,6 +224,9 @@ AC_OUTPUT([Makefile
        bin/pap/Makefile
        bin/psorder/Makefile
        config/Makefile
+       contrib/Makefile
+       contrib/nu/Makefile
+       contrib/printing/Makefile
        etc/Makefile
        etc/afpd/Makefile
        etc/afpd/nls/Makefile
index 570ee302a435e1cbce6139fc60c3bc93c39755fe..618ad1630f263e0293fdf24c1b407aeee32dcdcd 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile.am for contrib/
 
-SUBDIRS = printing
+SUBDIRS = nu printing
 
 EXTRA_DIST = ICDumpSuffixMap
diff --git a/contrib/nu/Makefile.am b/contrib/nu/Makefile.am
new file mode 100644 (file)
index 0000000..359527d
--- /dev/null
@@ -0,0 +1,3 @@
+# Makefile.am for contrib/nu
+
+bin_SCRIPTS = nu
diff --git a/contrib/nu/nu b/contrib/nu/nu
new file mode 100755 (executable)
index 0000000..ecd7a13
--- /dev/null
@@ -0,0 +1,26 @@
+#! /usr/bin/perl
+
+# nu - by Anders Brownworth   anders@thehamptons.com
+#      modified by Ambrose Li <acli@mail.mingpaoxpress.com>
+#
+# shows netatalk users logged on
+#
+# usage: nu
+
+open(USERS, "-|") || exec("/bin/ps", "anucx");
+
+while (<USERS>) {
+   push(@users, $1) if /^\s*(\d+)\s.*\bafpd\b/;
+}
+
+close USERS;
+
+print "Netatalk users:\n---------------\n";
+
+foreach $user (@users)
+{
+  if ($user) {  # not root
+    ($name,$_,$_,$_,$_,$_,$gcos) = getpwuid($user);
+    print(defined $gcos && $gcos =~ /^([^,]+)/? $1: $name, "\n");
+  }
+}