Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-24-2004, 05:14 AM   #1
LQ Newbie
Registered: Apr 2002
Location: Holland
Distribution: SuSe 8.0
Posts: 11

Rep: Reputation: 0
rpcinfo script

I have made the following script to target all the computers that ar listed in a input file and check if mountd is running true a rpcinfo request. Using this script I can check if users ar making mountd available to the network what is not the company rule.

This code is working buth there are some things that do not work and do not apply to the rule.

This are the things I like to add buth I have no clue how this should be done.

I like to check first if RPC is running or not and do this in a defined time that I can set. Something like wait fore 2 sec before skipping the computer and go to the next.

If RPC is running than do the check "rpcinfo -p $line |grep mountd"

and then if mountd is runnig a output of "showmount -e $line" because there ar some computers that are allowd to run distribution mounts to be accesd by the rest of the network.

What I like to know is how I can make a "if then" like statement based on the returning results. Anybody can help me with this problem?

# show RPC results from list op IP's

echo "    Enter target input file:" 
read inputfile 

  while read line 
    echo '  Checking : '$line 
       rpcinfo -p $line |grep mountd 
Thanks already,
Old 04-24-2004, 06:39 PM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
if /bin/false 'False is a program that ignores all parameters like this and fails' ; then 
  echo 'This command succseeded'
  echo 'This program failed' 

if /bin/true 'True is similar to false, but it does not fail. Replace your own program here' ; then 
  echo 'This command succseeded'
  echo 'This program failed' 


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM
rpcinfo tmorton Linux - Networking 0 09-17-2003 02:13 PM
showmount fails but rpcinfo works? rindress Linux - Networking 0 06-20-2003 01:58 PM > Forums > Non-*NIX Forums > Programming

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

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