Help needed with bash script providing battery status
I'm really new to even doing a bash "hello world" script, so maybe someone would know how to do the following task, using bash scripting
Need to login using ssh from one dell server into another dell server, and obtain the raid battery status, using dell's open manage software commands; then provide those results back to the first server
so I tried on my own from some bash tutorials, but all my script does is log me into the remote server and kicks me back to the orig server
here's what i have, still not sure if bash scripting is as simple as DOS batch files or if it involves a bit more
su9 ssh [IP]
omreport storage battery >> [path to the text file on orig server]
logout
seems as though the ssh session kicks me out without even issuing the logout command, so i'm losing the ssh connection somehow also, possibly even before the omreport command runs
ssh doesn't work like that. It tries to run the 'ssh' command locally, waits for it to finish, then tries to run the 'omreport' command locally because you didn't feed the following things into ssh. To feed commands into ssh, you must feed them into ssh. There's several ways to do that.
To run one command on the remote server:
It will run that command then immediately return.
It will run the shell script given between <<EOF and EOF.
I have a file /u/setuplink.txt
more setuplink.txt
ln -s /u/force.sh stopf.sh
ln -s /u/tnohup.sh tnohup.sh
ln -s /u/quick.sh startquick.sh
more runstat.sh
#!/bin/bash -e
echo "START"
/u/setuplink.txt
echo "END"
i wish to exit the runstat.sh for any errors except if the link... (2 Replies)
I have a small script I wrote to look for empty files on a Linux box. It finds the empty files and emails the list to me. That works great. What I need to do now is set a cron job to run the thing every 10 minutes or so (no problems there) but I don't want to get any more emails if the last email... (14 Replies)
I am looking for a way to start a script and have it prompt for a password that will be used later on in the script to SSH to another host and to SFTP. I don't want the password to be hard coded. Below is my script with the actual IP's and usernames removed.
#!/usr/bin/expect -f... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
2. Shell Bash Script
3.
!/bin/bash
if
echo no directory
then
mkdir -p /home/AC_Drywall
elif ; then
echo "$dir already exist"
fi (4 Replies)
#!/bin/bash
timevar=`date +%d-%m-%Y_%H.%M.%S` #-- > Storing Date and Time in a Variable
get_contents=`cat urls.txt` #-- > Getting content of website from file. Note the file should not contain any http:// as its already been taken care of
echo "Datae-time URL Status code Report" >... (2 Replies)
#!/bin/bash
timevar=`date +%F_”%H_%M”` #-- > Storing Date and Time in a Variable
get_contents=`cat urls.txt` #-- > Getting content of website from file. Note the file should not contain any http:// as its already been taken care of
######### Next Section Does all the processing #########
for i... (0 Replies)
Hi,
Can someone help me with creating a bash shell script.
I need to create a script that gets a positive number n as an argument.
The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Hi can someone tell me what command i can use to find the NIC status im using the bash shell. I'v tried ifconfig -a but this comes back as command not found. (3 Replies)
Hi!
I want to write a script that will create an archive (via tar) that will restrict the size of the tar file. The size can be constrained using the keyword 'k' and providing the size restriction. The problem is that the script needs to know (detect) when the tar command prompts the user (which... (2 Replies)