Awesome, thats perfect... thanks.
On Mon, 14 Mar 2005 22:27:02 +0100, Morten Nilsen <[EMAIL PROTECTED]> wrote:
> John Tate wrote:
> > Anyone got any ideas on a script that would disable or enable every
> > user account in a given group, as in specify a group and every user in
> > it would be effected?
> >
>
> cat > /sbin/disablegroup << EOF
> #!/bin/bash
>
> if [ "x$1" == "x" -o "x$2" == "x" ]; then
> echo "Usage: `basename $0` [-l|-u] [group]"
> fi
>
> for user in `awk -F: '
> $1=="'"$2"'"{
> if($4) {
> if(match(/,/, $4)) {
> split($4, users, /,/);
> for(user in users)
> print user
> } else
> print $4
> }
> }
> ' /etc/group`; do
> passwd $1 $user
> done
> EOF
>
> this script that I just wipped together will lock/unlock all users
> listed in /etc/group for the group specified.
>
> it will not, however, disable users only attached to a group in
> /etc/passwd. if you need that functionality, you should add it.
>
> Cheers,
> --
> Morten
> _______________________________________________
> tsl-discuss mailing list
> [email protected]
> http://lists.trustix.org/mailman/listinfo/tsl-discuss
>
--
John "Rockstar" Tate
Mobile: 0413 348 815 (Yep, old number, but I have a new phone)
Do you want a badass email that has fully customisable filters, an
awesome spam block, an easy to use interface that totally kicks arse?
AND MORE (see www.gmail.com)
If you like the sound of this ask me, a gmailer for an invite.
This endorsement messege was written by John Tate, who recieves no
money from Google Corp for bearing it on his signitaure.
http://kintarowins.deviantart.com/
_______________________________________________
tsl-discuss mailing list
[email protected]
http://lists.trustix.org/mailman/listinfo/tsl-discuss