LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-24-2004, 05:14 AM   #1
Ljohan
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.

1)
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.

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

3)
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?


Code:
#!/bin/sh 
# show RPC results from list op IP's

echo "    Enter target input file:" 
read inputfile 


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

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

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


Reply


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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration