status 738 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/rc
  2. cd /mnt/keys/$1 > /dev/null >[2=1] && {
  3. stat=`{cat status}
  4. exp=`{cat expire}
  5. switch($exp){
  6. case never 0
  7. exp='never expires'
  8. case *
  9. exp=(expires on `{date $exp})
  10. }
  11. switch($stat){
  12. case expired
  13. echo user $1: plan 9 key has expired
  14. case *
  15. echo user $1: plan 9 key status is $stat and $exp
  16. }
  17. grep '^'$1'[ ]' /adm/keys.who | tail -1
  18. }
  19. cd /mnt/netkeys/$1 > /dev/null >[2=1] && {
  20. stat=`{cat status}
  21. exp=`{cat expire}
  22. switch($exp){
  23. case never 0
  24. exp='never expires'
  25. case *
  26. exp=(expires on `{date $exp})
  27. }
  28. switch($stat){
  29. case expired
  30. echo user $1: network key has expired
  31. case *
  32. echo user $1: network key status is $stat and $exp
  33. auth/printnetkey $1
  34. }
  35. grep '^'$1'[ ]' /adm/netkeys.who | tail -1
  36. }