#! /bin/sh # # Script to unlock accounts of those having ids in file given as command-line # parameter. Each line of the file must begin with a user id for an account # to be unlocked. 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 unlocked." exit 2 fi while read line do id=`echo $line | cut -d ' ' -f1` passwd -u "$id" done < "$1" exit 0