How to pass port number in stop script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to pass port number in stop script
# 1  
Old 02-08-2012
How to pass port number in stop script

In unix i have to start service and it promts to enter port number:

/usr/mydir/ca >./stop_ca_devp

And it prompts message like :

Enter the port number of the server you would like to shut down :

Then I type xxxx then it stops the service.Now what I need is remove manual intervention. SO I need to run stop script from some script by passing port in advance.Can you please help me how to do this?

ThanksKrsna..
# 2  
Old 02-08-2012
MySQL

try the below option. it might help you.
Before invoke the stop_ca_devp script update the port variable
Code:
port=xxxx
./stop_ca_devp  <<__EOF__
$port
__EOF__

Thanks,
Kalai

Moderator's Comments:
Mod Comment How to use code tags

Last edited by Franklin52; 02-08-2012 at 09:30 AM.. Reason: Please use code tags for code and data samples, thank you
This User Gave Thanks to kalpeer For This Post:
# 3  
Old 02-09-2012
Thanks Mate,

It is working exactly ...

Thanks
Krsna..

---------- Post updated 02-09-12 at 06:38 AM ---------- Previous update was 02-08-12 at 08:27 AM ----------

Hi kalpeer,

I have got one more situation where I have to use same login but seems not working.

I am doing ssh:

ssh ip_addr ls -al /opt and this is asking me password. I want to again eliminate this need of entering password again. i tried like

./test.sh:
passd=xxxx
ssh ip_addr ls -al /opt << _EOF_
$passd
_EOF_
______________________

./test.sh
it again ask password?

An you please help me ?

Thanks
Krsna..
# 4  
Old 02-09-2012
MySQL

hi,

Even I have tried to automate the ssh login with password and am not able to automate it.
one simple thing is you can automate the ssh login using the keys.
below link talks about it
<linuxproblem.org/art_9.html>

Thanks,
Kalai
This User Gave Thanks to kalpeer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies

2. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

3. Red Hat

pass a variable line number to sed

num=10 sed -n '$num p' test.txt sed -n '10 p' test.txt works however i am putting the sed command in a loop and the line number is not static Can someone please help me how to achive this. (1 Reply)
Discussion started by: figure20012
1 Replies

4. Shell Programming and Scripting

How to pass different number of arguments in a single shot

I have one configuration file. The number of lines in the file will vary. I need to pass each line as a parameter to a shell script in a single shot. Ex: Suppose file contains: ou=x,o=z o=y Suppose the shell script name is sample.sh. Then the script should be called like sample.sh ou=x.o=z... (6 Replies)
Discussion started by: saurabhkoar
6 Replies

5. Shell Programming and Scripting

How to input a number in a web page and pass to a script?

I am working on an embedded linux router and trying to make a webpage where the user can input a desired number of CPE and have a script update that number on the router. I have a CLI where I can log in and type the following to change that number echo "20">/proc/net/dbrctl/maxcpe which then... (7 Replies)
Discussion started by: BobTheBulldog
7 Replies

6. Cybersecurity

IPF pass in connection to port 21 even with no explicit rule

I'm running IPF on solaris 10 bash-3.00# ipf -V #display ipf version ipf: IP Filter: v4.1.9 (592) Kernel: IP Filter: v4.1.9 Running: yes Log Flags: 0 = none set Default: pass all, Logging: available Active list: 1 Feature mask: 0x107 with the following rules bash-3.00# ipfstat -o -i... (0 Replies)
Discussion started by: h@foorsa.biz
0 Replies

7. Shell Programming and Scripting

What is the maximum number of parameter we can pass to a shell script function?

what is the maximum number of parameter we can pass to a shell script function (8 Replies)
Discussion started by: alokjyotibal
8 Replies

8. AIX

Get CDE/dtlogin to stop listening on port 6000

Hi all, can anyone help me with this? I'm running AIX 5L v5.3 base and installed CDE is 1.0. I've seen recommendations to add "-nolisten tcp" to the args for X but anytime I try that it simply fails to start. I've tried adding it as an arg to /usr/dt/config/Xservers as well as trying to add it... (0 Replies)
Discussion started by: AIXNewbie
0 Replies

9. UNIX for Dummies Questions & Answers

awk | stop after specified number of results

I am searching some rather large text files using grep and or awk. What I would like to know is if there is a way (either with grep, awk, or realy any other unix tool) to stop the search when a predifined number of results are returned. I would like to do this for speed purpuses. When i get... (6 Replies)
Discussion started by: evan108
6 Replies
Login or Register to Ask a Question