#!/bin/bash
# (c) 2002-2003 Newisys, Inc.  All rights reserved.
#
# Example shell script to add the manager-level users 'jack' and 'jill'
# with the password 'password' on a set of Service Processors.
#
# Requires: 
#    sp-ips.txt file with list of IP addresses for each Service Processor to connect to.
#    To be run from an SSH client. 
# See documentation for more information about commands.
#
for ip in `cat sp-ips.txt` ; do
   echo "Processing IP: $ip";
   ssh $ip access add user --user jack --password password --group manager
   if [ $? != 0 ]; then
      echo Error adding jack to SP $ip 
   fi
   ssh $ip access add user --user jill --password password --group manager
   if [ $? != 0 ]; then
      echo Error adding jill to SP $ip 
   fi
done

