]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Add a check to be sure the user has tokens, and add some whitespace to
authorRuss Allbery <rra@debian.org>
Fri, 26 Aug 2005 08:25:43 +0000 (08:25 +0000)
committerRuss Allbery <rra@debian.org>
Fri, 26 Aug 2005 08:25:43 +0000 (08:25 +0000)
help readability.

debian/afs-rootvol

index ce239a7cebbfc8381c28ae1d092f3238ffb7b0de..9a8da2f2eeeb4030e4e0a571f74625a36b3eb09f 100644 (file)
@@ -31,6 +31,7 @@ root.afs.
 Sam Hartman <hartmans@debian.org>
 
 =cut
+#'# cperl-mode
 
 # This subroutine creates a volume, mounts it and then sets the access
 # to allow read by anyuser.  The volume is scheduled for deletion in
@@ -105,6 +106,14 @@ unless ($part) {
     $part = $rl->readline("What partition? [a] ");
     $part = "a" unless $part;
 }
+print "\n";
+
+# Make sure the user has tokens.  Forgetting to do this is a common error.
+my $status = system("tokens | grep Expires > /dev/null");
+if ($status != 0) {
+    die "You appear to not have AFS tokens.  Obtain tokens (with aklog,\n"
+        . "for example) and then run this script again.\n";
+}
 
 # Figure out where root.afs is.  There are two possibilities: either we aren't
 # running with dynroot, and root.afs is therefore accessible as /afs, or we