#!/bin/ksh ############################################################# # unlock: Unlocks user accounts without going through the # pain and agony of SAM # Author: Doug O'Leary # Created: 11/05/96 # Updated: 11/05/96: Initial creation # 02/14/00: Added error checking logic (checks to # see if ${File} exists. Doug O'Leary ############################################################# ################ Usage function ########################### usage() { print "" print "usage: ${Cmd} USER_ID" print "" exit 1 } ############### Check args ############################# export PATH=/usr/bin Cmd=${0##*/} if [ $# != 1 ] then usage fi User=$1 ################ ID tcb pw file ########################### Letter=$(echo ${User} | cut -c1) File="/tcb/files/auth/${Letter}/${User}" if [ ! -f ${File} ] then print "" print "${User}'s pwd file doesn't exist." usage fi ############### Make a backup of the original ############# Date=$(date +%y%m%d) cp ${File} ${File}.${Date} ################ Eliminate the lock ####################### sed s/u_numunsuclog#[0-9]*://g ${File} > /tmp/temp$$ mv /tmp/temp$$ ${File}