Author: baggins
Date: Thu Apr 26 16:55:36 2007
New Revision: 8470

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- generic check_portmapper function


Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions      (original)
+++ rc-scripts/trunk/rc.d/init.d/functions      Thu Apr 26 16:55:36 2007
@@ -878,6 +878,22 @@
        mv -f /etc/mtab.clean /etc/mtab
 }
 
+# Check if any flavor of portmapper is running
+check_portmapper() {
+       RPCINFO=$(which rpcinfo)
+       if [ -x "$RPCINFO" ]; then
+               if $RPCINFO -p localhost >/dev/null 2>/dev/null ; then
+                       return 0 
+               else
+                       return 1
+               fi
+       elif [ -x /sbin/pidof ]; then
+               [ -z "`/sbin/pidof portmap`" -a \
+                 -z "`/sbin/pidof rpcbind`" ] && return 1
+       fi
+       return 0
+}
+
 rc_cache_init() {
        # If we have cachefile, use it.
        # If we don't, create memory variables and try to save silently,
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to