1834429 Members
2377 Online
110067 Solutions
New Discussion

Re: Shell script

 
SOLVED
Go to solution
AIMC
Frequent Advisor

Shell script

Hello,

I am trying to write a fairly simple shell script & need some help(see below), instead of changing the script for every VA array I want a universal script so i don't have to change the alias every time. Also attached is a sample output of the command that gives the array alias.

#script at the moment#

mkdir /va || exit 1
armdowmload -I D imogenva74-1 > /va/armdownload_I.txt || exit 1
armdsp -d imogenva74-1 > /va/armdsp_d.txt || exit 1
armdiag -W imogenva74-1 > /va/armdiag_W.txt || exit 1
armdsp -c imogenva74-1 > /va/armdsp_c.txt || exit 1
armdsp -a imogenva74-1 > /va/armdsp_a.txt || exit 1
cd /va || exit 1
tar cvf /tmp/vainfo.tar . || exit 1
cd / || exit 1
rm -R /va
print THE OUTPUT IS IN /tmp/vainfo.tar PLEASE E-MAIL TO aidan.mcardle@hp.com || exit 1


#armdsp -i
Product ID: HP-A6189A
Device Type: Virtual Disk Array
Alias: imogenva74-1
World Wide Name: 50060b0000092940
Unique ID: HPA6189A00SG141G0061
Serial Number: 00SG141G0061
2 REPLIES 2
Patrick Wallek
Honored Contributor
Solution

Re: Shell script

#!/usr/bin/sh

ALIAS=$(armdsp -i | grep Alias | awk '{print $2}')

mkdir /va || exit 1
armdownload -l D ${ALIAS} > /va/armdownload_l.txt || exit1

Just substitute ${ALIAS} anyplace the array name goes and you should be set.
AIMC
Frequent Advisor

Re: Shell script

Thanks Patrick, I will try this.

Aidan