-   Programming (
-   -   rpcinfo script (

Ljohan 02-24-2004 06:14 AM

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,

ToniT 04-24-2004 07:39 PM


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'

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