]> arthur.barton.de Git - netatalk.git/blobdiff - contrib/shell_utils/asip-status.pl.in
Spotlight: use async Tracker SPARQL API
[netatalk.git] / contrib / shell_utils / asip-status.pl.in
index ccd0332edd6c4ccf7094a71d2a1e08f8f743a9e4..c4036a81cfe10d0659d487bd51ab64880b945b49 100755 (executable)
@@ -16,7 +16,7 @@
 #
 
 #
-# This edition is a part of netatalk.
+# This edition is a part of netatalk @NETATALK_VERSION@.
 #
 
 use strict;
@@ -32,12 +32,29 @@ while ($arg = shift @ARGV)
        $main::show_icon = 1 if ($arg eq "-i");
        $main::debug = 1 if ($arg eq "-d");
        $main::hexdump = 1 if ($arg eq "-x");
+       $main::showver = 1 if ($arg eq "-v");
+       $main::showver = 1 if ($arg eq "-version");
+       $main::showver = 1 if ($arg eq "--version");
        $hostport = $arg if ($arg !~ /^-/);
 }
 
+if ($main::showver ==1)
+{
+        print "$0\n";
+        print "Original edition: 7 May 1997 \(v1.0\) James W. Abendschan\n";
+        print "This edition is a part of Netatalk @NETATALK_VERSION@\n";
+        exit(-1);
+}
+
 if ($hostport eq "")
 {
-       print "usage: $0 hostname[:port] [-i show icon] [-d debug] [-x hex dump]\n";
+       print "usage: $0 [-d] [-i] [-x] hostname[:port]\n";
+       print "       $0 -v|-version|--version\n";
+       print "Queries AFP servers for their capabilities.\n";
+       print "  -d: Enable debug output.\n";
+       print "  -i: Show icon if it exists.\n";
+       print "  -x: Enable hex dump output.\n";
+       print "  -v,-version,--version: Show version.\n";
        exit(-1);
 }
 
@@ -212,14 +229,20 @@ sub parse_FPGetSrvrInfo()
 
        my ($icon_offset) = unpack("n", @packet[6] . @packet[7]);
        print "Volume Icon & Mask offset: $icon_offset\n" if ($main::debug);
-       print "Volume Icon & Mask: exist\n" if ($icon_offset);
+       print "Volume Icon & Mask: ";
+       if ($icon_offset) {
+           print "Yes\n";
+       } else {
+           print "No\n";
+       }
 
        my ($flags) = unpack("n", @packet[8] . @packet[9]);
        my (@flags) = parse_afp_flags($flags);
 
        print "Flags: ";
-       print "$flags - " if ($main::debug);
-       print join(",", @flags) . "\n";
+       print "$flags" if ($main::debug);
+       print "\n";
+       print join("\n", @flags) . "\n";
 
        # server name starts at offset+10, length byte first.
 
@@ -389,18 +412,22 @@ sub parse_afp_flags
 
        # $flags is a 16 bit little-endian number
 
-       push (@flags, "SupportsCopyFile") if ($flags & (1<<0));
-       push (@flags, "SupportsChgPwd") if ($flags & (1<<1));
-       push (@flags, "DontAllowSavePwd") if ($flags & (1<<2));
-       push (@flags, "SupportsServerMessages") if ($flags & (1<<3));
-       push (@flags, "SupportsServerSignature") if ($flags & (1<<4));
-       push (@flags, "SupportsTCP/IP") if ($flags & (1<<5));
-       push (@flags, "SupportsSrvrNotifications") if ($flags & (1<<6));
-       push (@flags, "SupportsReconnect") if ($flags & (1<<7));
-       push (@flags, "SupportsOpenDirectory") if ($flags & (1<<8));
-       push (@flags, "SupportsUTF8Servername") if ($flags & (1<<9));
-       push (@flags, "SupportsUUIDs") if ($flags & (1<<10));
-       push (@flags, "SupportsSuperClient") if ($flags & (1<<15));
+       push (@flags, "    SupportsCopyFile") if ($flags & (1<<0));
+       push (@flags, "    SupportsChgPwd") if ($flags & (1<<1));
+       push (@flags, "    DontAllowSavePwd") if ($flags & (1<<2));
+       push (@flags, "    SupportsServerMessages") if ($flags & (1<<3));
+       push (@flags, "    SupportsServerSignature") if ($flags & (1<<4));
+       push (@flags, "    SupportsTCP/IP") if ($flags & (1<<5));
+       push (@flags, "    SupportsSrvrNotifications") if ($flags & (1<<6));
+       push (@flags, "    SupportsReconnect") if ($flags & (1<<7));
+       push (@flags, "    SupportsOpenDirectory") if ($flags & (1<<8));
+       push (@flags, "    SupportsUTF8Servername") if ($flags & (1<<9));
+       push (@flags, "    SupportsUUIDs") if ($flags & (1<<10));
+       push (@flags, "    SupportsExtSleep") if ($flags & (1<<11));
+       push (@flags, "    UnknownBit12") if ($flags & (1<<12));
+       push (@flags, "    UnknownBit13") if ($flags & (1<<13));
+       push (@flags, "    UnknownBit14") if ($flags & (1<<14));
+       push (@flags, "    SupportsSuperClient") if ($flags & (1<<15));
 
        return @flags;
 }