############################################################################# # update_ssop - Create XML to change Lawson SSO passwords with ssoconfig # from your list of ids,passwords # BACKUP YOUR LDAP BEFORE USE # -- Special Thanks to Kirk House at Hanes Brands for the idea -- # J. David Schronce - Tue Nov 4 09:32:44 EST 2008 ############################################################################# USAGE="USAGE: $0 CSV_FILE Where CSV_FILE is a 2 column, comma separated listing, in the format username,password" if [ $# -lt 1 ] || [ $# -gt 1 ]; then echo "\n$USAGE\n" exit 1 fi CSVFILE=$1 OUTPUT=ssop_change.xml # Create File header echo "" > $OUTPUT echo "" >> $OUTPUT # Read line data from csvfile linecnt=0 echo "Processing...\c" cat $CSVFILE | while read csvline; do # Parse columns linecnt=`echo "$linecnt + 1" | bc` echo ".\c" USER=`echo "$csvline" | cut -d"," -f1` PASSWD=`echo "$csvline" | cut -d"," -f2` # echo "$USER - $PASSWD" if [ "X$PASSWD" = "X" ]; then rm $OUTPUT echo "\ndata error at line $linecnt" echo "Fix data error and try again\n" exit 1 fi # Add additional SERVICENAMES to the line below for servicename in SSOP $LAWENVNAME do echo "" >> $OUTPUT echo " " >> $OUTPUT echo " " >> $OUTPUT echo " " >> $OUTPUT echo "" >> $OUTPUT done done # Close xml echo "" >> $OUTPUT # Display instructions echo "\n Please examine $OUTPUT for omissions or errors, then execute" echo "\nssoconfig -l $OUTPUT" echo "\nto make password changes..."