Here is a copy of the .sh script... the idea is that it updates the configuration of Dell remote access cards which are in-built into Dell servers.
I would greatly appriciate some help, I have zero vbs skills... : (
+++++++++++++++++
#!/bin/bash
# File containing a list of IP address - one in each line
ipfile=ipaddr.txt
# This is the drac configuration file which contains the configuration.
dracconfigfile=drac.cfg
# Logfile to store the logs of the execution
logfile=config.log
# RACADM command to be executed
racadm_command="racadm -u root -p password"
if [ ! -r $ipfile ]; then
echo "IP address file $ipfile not found or cannot be read"
exit
fi
if [ ! -r $dracconfigfile ]; then
echo "DRAC configuration file $dracconfigfile not found or cannot be read"
exit
fi
# Logfile gets overwritten everytime this script is executed
echo "Starting batch configuration of DRAC from file $ipfile" > $logfile
while read line; do
# Ingnore blank lines
[ -z "$line" ] && continue
# Ingnore comments (lines with a ;)
echo $line | grep "^;" > /dev/null
[ $? -eq 0 ] && continue
echo Configuring DRAC at ip address: $line
echo "========================================" >> $logfile
echo "DRAC IP = $line" >> $logfile
echo y | $racadm_command -r $line config -f drac.cfg >> $logfile 2>&1
if [ $? -ne 0 ]; then
echo "Failed. See logfile for details"
else
echo "DRAC configured successfully"
fi
done < $ipfile
echo Done
++++++++++++++++++++
From this point on it is the Drac.cfg file data...
[idRacInfo]
# idRacType=6
# idRacProductInfo=Dell Remote Access Controller 5
# idRacDescriptionInfo=This system component provides a complete set of remote management functions for Dell PowerEdge servers
# idRacVersionInfo=1.33
# idRacBuildInfo=08.07.11
# idRacName=DRAC 5
# To change username or password for a user
# Note: cfgUserAdminIndex line should be commented
[cfgUserAdmin]
# cfgUserAdminIndex=4
cfgUserAdminUserName=username
cfgUserAdminPassword=password
[cfgUserAdmin]
# cfgUserAdminIndex=5
cfgUserAdminUserName=username
cfgUserAdminPassword=password
[cfgUserAdmin]
# cfgUserAdminIndex=6
cfgUserAdminUserName=username
cfgUserAdminPassword=password
# For more users copy paste the entire sections
# To add and enable a user use the section below
[cfgUserAdmin]
# cfgUserAdminIndex=9
cfgUserAdminUserName=username
cfgUserAdminPassword=password
cfgUserAdminPrivilege=0x00000000
cfgUserAdminIpmiLanPrivilege=15
cfgUserAdminIpmiSerialPrivilege=15
cfgUserAdminSolEnable=0
cfgUserAdminEnable=1
# To configure Active directory uncomment these lines
# and edit the values
# [cfgActiveDirectory]
# cfgADEnable=0
# cfgADRacDomain=ourplace.org.au
# cfgADRootDomain=ourplace.org.au
# cfgADRacName=testdrac
# cfgADAuthTimeout=120
# cfgADType=1
# cfgADSmartCardLogonEnable=0
# cfgADCRLEnable=0
# cfgADSpecifyServerEnable=0
# cfgADDomainController=0.0.0.0
# cfgADGlobalCatalog=0.0.0.0
# cfgAODomain=0.0.0.0
# [cfgStandardSchema]
# cfgSSADRoleGroupIndex=1
# cfgSSADRoleGroupName=dracgrp
# cfgSSADRoleGroupDomain=ourplace.org.au
# cfgSSADRoleGroupPrivilege=0x000001ff
Last edited by Tekmaven : Jul 22nd, 2008 at 7:41 pm. Reason: Code tags