LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2006, 03:36 PM   #1
MPowers
LQ Newbie
 
Registered: Jun 2005
Posts: 25

Rep: Reputation: 15
Service check script


Hi all,
I want some script that connects to telnet to one of my access points and if access point prompt me for username and pass everything is ok, but the problem is when it not responds, and in that situation the script will execute some linux command. Who can make that simple script for me?

Thank you!
 
Old 01-24-2006, 12:42 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Code:
#!/bin/bash
AP="192.168.0.1"
COMMAND="some linux command"
ping -c1 $AP 2>&1 > /dev/null
if [[ $? == 0 ]]; then
    echo "everything is ok"
else
    $COMMAND
fi

Last edited by bulliver; 01-24-2006 at 12:45 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I start ftp service and check if port open? quintan Linux - Software 2 01-15-2018 02:02 AM
Nagios - Return code of 127 for check of service sriramsreedhar Linux - General 5 11-14-2016 02:32 PM
way to check and see if a service is running nephish Linux - Software 10 02-11-2006 03:36 PM
check vulnerablity for all service in Linux yuva_mca Linux - Security 1 04-25-2004 04:10 AM
script to check if the service is running eyt Linux - Newbie 2 02-16-2004 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration