|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell script password input
hy, I wrote a simple shell script to monitor (with Nagios) a SNX VPN function. Here the Code snippet: Code:
testing=`ssh user@IP-address 'ls /etc/sysconfig/network-scripts/ifcfg-eth0'`
#echo $testing
if [ $testing = "/etc/sysconfig/network-scripts/ifcfg-eth0" > /dev/null 2>%1 ]; then
echo "VPN is working"
exit 0
else snx -s server -u user
exit 0
fiAs you could see if the VPN connection is establised I got a simple output text in Nagios. But when the VPN connection isnīt up and running I want to establise a connection with the command "snx -s server -u user". Than I have to put in a Password manually Code:
Check Point's Linux SNX build 800007075 Please enter your password: And there I run into problems. How could I automate such a login within the script? Any Ideas? regards Tommy |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
You could do this with Expect (Expect - Expect - Home Page).
|
| The Following User Says Thank You to zazzybob For This Useful Post: | ||
tomies (02-13-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks that works perfect for me...
![]() regards tommy |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to input encrpyted password into htdigest (Apache) | xxxx | Shell Programming and Scripting | 0 | 01-25-2012 01:42 AM |
| password file as std input to script | mpheine | Shell Programming and Scripting | 2 | 09-01-2011 04:45 PM |
| Input in shell script | urug3170 | Shell Programming and Scripting | 2 | 06-18-2010 11:13 AM |
| how to change root password using shell script with standard password | kurva | Shell Programming and Scripting | 2 | 02-25-2009 01:35 AM |
| Input to shell script | castlerock | Shell Programming and Scripting | 3 | 04-03-2006 05:26 AM |
|
|