User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 455,864 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,648 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums

.sh to vbs

Join Date: Jul 2008
Posts: 4
Reputation: stooartbaby is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
stooartbaby stooartbaby is offline Offline
Newbie Poster

Re: .sh to vbs

  #4  
Jul 22nd, 2008
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
Reply With Quote  
All times are GMT -4. The time now is 6:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC