[ d'MusicBox ] *

we're BLARING through your Monitors and Speakers!

SHELL script

Posted on | August 26, 2007 | No Comments

If you're new here, you may want to subscribe to my RSS feed. Also you may want to leave a comment to the posts. xD Thanks for visiting! |m|

at last!.. i have made my first successful shell script (not literally the first… just want to exaggerate it.. lolx)

the “simple” script that i made will just ping a host specified.. then show port 80 and 21 status.. and that’s it.. (lame script!.. lolx)

here’s the scipt:
#!/usr/local/bin/bash

echo “=============SERVER PING STATS============”;
ping -c3 $1
echo “==========================================”;
echo ” “;

echo “=========HTTP PORT CHECK(port 80)=========”;
nc -vvv -z $1 80
echo “Done!”;
echo “========END OF PORT CHECK(port 80)========”;
echo ” “;

echo “==========FTP PORT CHECK(port 21)==========”;
nc -vvv -z $1 21
echo “Done!”;
echo “========END OF PORT CHECK(port 21)=========”;
echo ” “;

I saved the script as portcheck and chmodded to 700…

here’s the result:

[+_Fueled_By_Ramen_+@root:~]—> portcheck tambayanbox.org
=============SERVER PING STATS============
PING tambayanbox.org (74.208.24.212): 56 data bytes
64 bytes from 74.208.24.212: icmp_seq=0 ttl=55 time=341.001 ms
64 bytes from 74.208.24.212: icmp_seq=1 ttl=55 time=336.076 ms
64 bytes from 74.208.24.212: icmp_seq=2 ttl=55 time=324.186 ms

— tambayanbox.org ping statistics —
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 324.186/333.754/341.001/7.058 ms
==========================================

=========HTTP PORT CHECK(port 80)=========
Connection to tambayanbox.org 80 port [tcp/http] succeeded!
Done!
========END OF PORT CHECK(port 80)========

==========FTP PORT CHECK(port 21)==========
Connection to tambayanbox.org 21 port [tcp/ftp] succeeded!
Done!
========END OF PORT CHECK(port 21)=========

me… happy… lolx…

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Like my article? Buy me a beer!


Comments

Leave a Reply





CommentLuv Enabled
  • About

    Just blogging and hopping! Do drop some comments in the posts or in the shoutbox. If you like the posts, you can subscribe to the RSS feed. If you came from Stumble and like the posts, it would not hurt if you click on "I like IT" :) Drop you card at my entrecard logo Entrecard users!

    I have temporarily disabled the shoutbox as a part of a little experiment. It will be back later. Just comment on the blog posts so that I can get back to you. Same as for link exchanges. Please link me in your site first as I link sites by batch to save time. Would love to exchange links :)

  • Show ME SOME LOVE!

  • Recent Posts

  • Sign up!

    ss_blog_claim=2d01d9cceed8bf4586ad69e7240e9d7c

    Publisher?! Sign Up Here!

    Advertiser?!.. Sign Up Here!

  • Get Adobe Flash playerPlugin by wpburn.com wordpress themes