/[svn.andrew.net.au]/scripts/interactive_accounts
ViewVC logotype

Annotation of /scripts/interactive_accounts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (hide annotations)
Sun Feb 10 18:16:27 2008 UTC (13 years, 9 months ago) by apollock
File size: 381 byte(s)
Script to find interactive accounts

1 apollock 40 #!/bin/bash
2    
3     for entry in $(getent passwd | cut -d: -f1,7 | grep -v -E "^(sash)?root:")
4     do
5     shell=$(echo $entry | cut -d: -f2)
6     if grep -q $shell /etc/shells; then
7     user=$(echo $entry | cut -d: -f1)
8     if [ $UID -eq 0 ]; then
9     case "$(getent shadow $user | cut -d: -f2)" in
10     "x"|"*"|"!"|"!"*)
11     ;;
12    
13     *)
14     echo $entry
15     ;;
16     esac
17     else
18     echo $entry
19     fi
20     fi
21     done

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.22