#! /bin/sh # # Script to lock accounts of those having ids in file given as the command-line # parameter. Each line of the file must begin with a user id for an account # to be locked. This file can be generated by checkexpired, but must be # edited by hand to be sure that needed accounts are not locked. if [ `whoami` != "root" ] then echo "Only root can run this script" exit 1 fi if [ $# != 1 ] then echo "Must have 1 argument: the name of the file of ids to be locked." exit 2 fi while read line do id=`echo $line | cut -d ' ' -f1` passwd -l "$id" done < "$1" exit 0