diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2007-07-02 21:44:25 +0000 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2007-07-02 21:44:25 +0000 |
commit | 1f77c2b72271ba0e8aad2eb4bfbe44133e395202 (patch) | |
tree | df6c049ff371e5ea1b200736d6cde1be131fb171 /net-misc/nxnode/files | |
parent | dev-util/monodevelop: aspnetedit use flag now requires either firefox or seam... (diff) | |
download | historical-1f77c2b72271ba0e8aad2eb4bfbe44133e395202.tar.gz historical-1f77c2b72271ba0e8aad2eb4bfbe44133e395202.tar.bz2 historical-1f77c2b72271ba0e8aad2eb4bfbe44133e395202.zip |
Maintenance release and nxsensor script fix
Package-Manager: portage-2.1.3_rc6
Diffstat (limited to 'net-misc/nxnode/files')
-rw-r--r-- | net-misc/nxnode/files/digest-nxnode-3.0.0-r1 | 6 | ||||
-rw-r--r-- | net-misc/nxnode/files/nxnode-3.0.0-init | 68 |
2 files changed, 74 insertions, 0 deletions
diff --git a/net-misc/nxnode/files/digest-nxnode-3.0.0-r1 b/net-misc/nxnode/files/digest-nxnode-3.0.0-r1 new file mode 100644 index 000000000000..3be2b997a637 --- /dev/null +++ b/net-misc/nxnode/files/digest-nxnode-3.0.0-r1 @@ -0,0 +1,6 @@ +MD5 c708996f1840d7330c4d29807f3e5fce nxnode-3.0.0-71.i386.tar.gz 6232314 +RMD160 86f14e369040695d6679d833e53b2df2bd620406 nxnode-3.0.0-71.i386.tar.gz 6232314 +SHA256 74bf1b56b3b57cc17429c46a24e8d6597dbdb8275aabb945af77b33360d507c8 nxnode-3.0.0-71.i386.tar.gz 6232314 +MD5 20ca631bdc58ec96bc0e1fd351c8493a nxnode-3.0.0-71.x86_64.tar.gz 6902680 +RMD160 092c350f82a736a36230079de395773ebf955750 nxnode-3.0.0-71.x86_64.tar.gz 6902680 +SHA256 d2cff4be636c0d1e8dd5fff344d1fb3c680eb3bc88f39655f78fefa9b3a3126c nxnode-3.0.0-71.x86_64.tar.gz 6902680 diff --git a/net-misc/nxnode/files/nxnode-3.0.0-init b/net-misc/nxnode/files/nxnode-3.0.0-init new file mode 100644 index 000000000000..8b897db7c88b --- /dev/null +++ b/net-misc/nxnode/files/nxnode-3.0.0-init @@ -0,0 +1,68 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +NX_NODE_CFG="/usr/NX/etc/node.cfg" +NX_SENSOR_CMD="/usr/NX/bin/nxsensor" +NX_SENSOR_PID="/usr/NX/var/run/nxsensor.pid" +NX_SENSOR_HOST="127.0.0.1" +NX_SENSOR_PORT="19250" + +depend() +{ + need net +} + +is_enabled() +{ + local tmp + + if ! [[ -x $NX_SENSOR_CMD ]] ; then + eerror "$NX_SENSOR_CMD not found" + return 1 + fi + + tmp=`/usr/bin/awk -F'"' '/^EnableSensor/ {print $2}' $NX_NODE_CFG` + if [[ $tmp != "1" ]]; then + eerror "nxsensor is disabled in $NX_NODE_CFG" + return 1 + fi + + tmp=`/usr/bin/awk -F'"' '/^StatisticsHost/ {print $2}' $NX_NODE_CFG` + if [[ -n $tmp ]] ; then + NX_SENSOR_HOST="$tmp" + fi + + tmp=`/usr/bin/awk -F'"' '/^NodeSensorPort/ {print $2}' $NX_NODE_CFG` + if [[ -n $tmp ]] ; then + NX_SENSOR_PORT="$tmp" + fi + + return 0 +} + +start() { + is_enabled || return 1 + ebegin "Starting nxsensor" + $NX_SENSOR_CMD -a $NX_SENSOR_HOST -a "::ffff:$NX_SENSOR_HOST" -P $NX_SENSOR_PORT -d + PID=`ps -ef | grep $NX_SENSOR_CMD | grep -v grep | awk '{print $2}'` + if [[ -z $PID ]] ; then + eend 1 + else + echo $PID > $NX_SENSOR_PID + eend 0 + fi +} + +stop() { + ebegin "Stopping nxsensor" + PID=`cat $NX_SENSOR_PID` + if [[ -z $PID ]] ; then + eerror "nxsensor not started" + eend 1 + else + kill $PID + rm -f $NX_SENSOR_PID + eend 0 + fi +} |