From: rufustfirefly Date: Fri, 4 Aug 2000 15:56:31 +0000 (+0000) Subject: Added "nu" to contrib (netatalk users script) X-Git-Tag: netatalk-1-5-rc1~738 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=7579c87b8ee5e748824a082fe4fef3f09a9a6c1c;p=netatalk.git Added "nu" to contrib (netatalk users script) --- diff --git a/Makefile.am b/Makefile.am index 0c8fa1e1..f5999c22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.in b/configure.in index d28d1c0a..3e76683c 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 570ee302..618ad163 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -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 index 00000000..359527dc --- /dev/null +++ b/contrib/nu/Makefile.am @@ -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 index 00000000..ecd7a138 --- /dev/null +++ b/contrib/nu/nu @@ -0,0 +1,26 @@ +#! /usr/bin/perl + +# nu - by Anders Brownworth anders@thehamptons.com +# modified by Ambrose Li +# +# shows netatalk users logged on +# +# usage: nu + +open(USERS, "-|") || exec("/bin/ps", "anucx"); + +while () { + 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"); + } +}