Script to login to attached SUN Storage through Solaris m/c w/o user intervention


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to login to attached SUN Storage through Solaris m/c w/o user intervention
# 1  
Old 04-20-2009
Script to login to attached SUN Storage through Solaris m/c w/o user intervention

I want to create a shell script to CLI login to attached SUN 6140 storage from Sun Solaris 9 m/c (instead of using CAM )
but that prompts me for password despite the fact that i am adding them in script .. i am using "expect" feature for this .. however as i never used "expect " before .. so requesting you guys to suggest ..

Below in my example script . (may have many errors ;-) )

[12:57pm] root@dwsmum1: # cat storage_disk_check_script_old.sh
#!/usr/local/bin/expect
set PASSWD=crscp6
echo "##### Check for Storage Disk Status #####\n"
# /opt/se6x20/cli/bin/sscs login -h localhost -u root
spawn /opt/se6x20/cli/bin/sscs login -h localhost -u root
expect {
Type your password: { send "$PASSWD\r" }
}
for i in `/opt/se6x20/cli/bin/sscs list array | awk '{print $2}'` ;
do /opt/se6x20/cli/bin/sscs list -a $i disk | grep -i Failed > /dev/null;
if [ $? = 0 ] ; then echo " Disk in Storage Array $i Failed " ;
else echo " All Disks in Storage Array $i Enabled " ;
fi ;
done
exit


*******

expected result ::

it will not prompt me as "Type your password:" instead take password from script and follow the instructions and quit ..

Thanks in Advance ..
/Yogesh
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To ask for user intervention

hi guys i want my cron to execute for every minute (5 Replies)
Discussion started by: azherkn3
5 Replies

2. Shell Programming and Scripting

How to write a shell script to automatically accept return key with out user intervention?

Hi Friends, i am creating a shell script which is accepting file name as input parameter from Java and invoking finacle service. The service will accpet text file,B2k_session id,etc and upload the text file data in finacle database. My shell script looks like this:- #! /bin/ksh... (2 Replies)
Discussion started by: vadlamudy
2 Replies

3. Solaris

How to differ local disks from attached from storage ones?

Hello. I have a solaris box with several local disks and several come from SYMMETRIX storage. Is there any way to tell format (or other util) to show only local disks? (6 Replies)
Discussion started by: urello
6 Replies

4. Shell Programming and Scripting

How to use ssh command in the shell script without user intervention?

Hello All, I need your help, i would like to know how to use ssh command in the shell scripts? and make the script continue to enter the password without user intervention example of the normal commands written manually: # ssh 172.30.1.256 -l mxread password: mxread Thanks in advance (3 Replies)
Discussion started by: Dendany83
3 Replies
Login or Register to Ask a Question
CHSH(1) 							   User Commands							   CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)