Sponsored Content
Top Forums Shell Programming and Scripting vpn connect/disconnect shell script Post 302355556 by chakrapani on Wednesday 23rd of September 2009 04:27:35 AM
Old 09-23-2009
Java

Will this work ... assuming you are using bash 2.03 or higher
------------------------------------------------------------------------
if nmap -P0 -p25 199.8.7.29 | grep -qi open >/dev/null 2>&1;
echo "[ $(/bin/date) ]: Partner VPN Failed" >> /var/log/monscrpt.log
mailx -s "Partner VPN Failed" 'aarti_sankhe@cactus.com' < /dev/null
exit 1;
else
echo "[ $(/bin/date) ]: VPN status looks good " >> /var/log/monscrpt.log
fi
exit 0;
------------------------------------------------------------------------

You might need to check with syntax ... mostly it will work
One thing I hate is log files without any date/time on when the event was last checked ... So I added that.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Connect over ssh, start something, disconnect

i'm connecting with ssh from a windows pc to a linux system. i want to start e.g. a download and close my session afterwards. how do i do this without killing the download? thx in advance. (2 Replies)
Discussion started by: sTorm
2 Replies

2. Shell Programming and Scripting

Connect two servers in shell script

Hello all, I know that is a question which has made too many times, and I have been looking into the threads but all posted was not sucessfully for me so... I need a shell script which connect two unix servers, but NOT using ssh... Is there another way to do it? I've tried ssh but it didn't... (1 Reply)
Discussion started by: Geller
1 Replies

3. Shell Programming and Scripting

Connect to oracle db using shell script

Hi, I want to connect to oracle db using unix shell script. And i want to retrieve data from db through shell script. Please help me as soon as possible. Thanks, J.P. Das (1 Reply)
Discussion started by: jyotidas
1 Replies

4. Ubuntu

Ubuntu 10.04 - Unable to connect to Cisco VPN

Hi all, I am trying to configure and connect Cisco VPN on Ubuntu 10.04. I've imported .pcf file. The new vpn conn appears in the VPN Connections option. Now when I select it, it doesn't connect. Nothing happens. I am not able to connect to VPN at all. I tried using kvpnc as well but it... (10 Replies)
Discussion started by: morningSunshine
10 Replies

5. Shell Programming and Scripting

connect to db2 using shell script

Guys, I am trying to write a shell script that connect to wcsprod database and read the query #!/bin/ksh sqlplus -s < connect to wcsprod user wcsadm using pwd > select * from catentry fetch first 1 row only with ur; databse: wcsprod user: wcsadm pwd: pwd thanks (1 Reply)
Discussion started by: skatpally
1 Replies

6. AIX

Help Me - AIX server connect to a VPN network

Hi, I have a task requested by my boss to create a script to enable a server to connect to a vpn network and then to connect to another server to upload some data... How can I connect to a vpn network from AIX server? via telnet? ssh? I have tried to google but mostly the answers are... (1 Reply)
Discussion started by: mushr00m
1 Replies

7. Shell Programming and Scripting

Connect once db disconnect after all execution

Hi All, Please see the below code. it is working fine when in 'test_file' have only one emplid. test_file contains only emplid and date, like below ... 0000221|1/12/2003 0000223|1/1/1996 Problem :- when test_file contains more then one records(emplids) it is not giving any errors... (3 Replies)
Discussion started by: krupasindhu18
3 Replies

8. Shell Programming and Scripting

Shell script to connect from one server to other

Dear Experts, I am new to the shell scripting. I am looking for a shell script to connect to one Unix/Linux server1 to other Unix/Linux server2 and trigger a SAP Event in that server2 (Which will trigger a job in SAP). Is this possible to connect from one server to the other server securely... (7 Replies)
Discussion started by: Venu V Reddy
7 Replies

9. Shell Programming and Scripting

Shell script to connect

hello i try to made a report to conect all database to diferent OS HP-UX/LINUX/SOLARIS/AIX this is my example i have 5 db OS are HP-UX ps -fea | grep pmon root 1120 1 0 Nov 29 ? 5:14 ipmon -sD oracle 10286 1 0 Nov 29 ? 27:19 ora_pmon_BD1 oracle 10431... (7 Replies)
Discussion started by: ceciaide
7 Replies

10. Shell Programming and Scripting

Trigger the execution of a script on SFTP Disconnect

Hi Guys, I suspect what I'm trying to do isn't possible, but I'm hoping someone can either confirm this or point me in the right direction. We have a third-party application which transfers a collection of files to our SFTP server ( Ubuntu 12.04 with OpenSSH ) . Once the app disconnects, we... (13 Replies)
Discussion started by: jamesdrinkwater
13 Replies
PPPOE-CONNECT(8)					      System Manager's Manual						  PPPOE-CONNECT(8)

NAME
pppoe-connect - Shell script to manage a PPPoE link SYNOPSIS
pppoe-connect [config_file] pppoe-connect interface user [config_file] DESCRIPTION
pppoe-connect is a shell script which manages a PPPoE connection using the Roaring Penguin user-space PPPoE client. If you omit con- fig_file, the default file /etc/ppp/pppoe.conf is used. If you supply interface and user, then they override the Ethernet interface and user-name settings in the configuration file. Note that normally, you should not invoke pppoe-connect directly. Instead, use pppoe-start to bring up the PPPoE connection. pppoe-connect first reads a configuration file. It then brings up a PPPoE connection. If the connection ever drops, a message is logged to syslog, and pppoe-connect re-establishes the connection. In addition, each time the connection is dropped or cannot be established, pppoe-connect executes the script /etc/ppp/pppoe-lost if it exists and is executable. The shell script pppoe-stop causes pppoe-connect to break out of its loop, bring the connection down, and exit. TECHNICAL DETAILS
pppoe-connect uses the following shell variables from the configuration file: ETH The Ethernet interface connected to the DSL modem (for example, eth0). USER The PPPoE user-id (for example, b1xxnxnx@sympatico.ca). PIDFILE A file in which to write the process-ID of the pppoe-connect process (for example, /var/run/pppoe.pid). Two additional files ($PID- FILE.pppd and $PIDFILE.pppoe) hold the process-ID's of the pppd and pppoe processes, respectively. By using different configuration files with different PIDFILE settings, you can manage multiple PPPoE connections. Just specify the con- figuration file as an argument to pppoe-start and pppoe-stop. AUTHOR
pppoe-connect was written by David F. Skoll <dfs@roaringpenguin.com>. The pppoe home page is http://www.roaringpenguin.com/pppoe/. SEE ALSO
pppoe(8), pppoe-start(8), pppoe-stop(8), pppd(8), pppoe.conf(5), pppoe-setup(8), pppoe-status(8), pppoe-sniff(8), pppoe-server(8), pppoe- relay(8) 4th Berkeley Distribution 21 February 2000 PPPOE-CONNECT(8)
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy