Commit 3423dd95 authored by Andrew McNab's avatar Andrew McNab
Browse files

Try hostname -f too

parent d1c2cea0
......@@ -10,16 +10,13 @@
# Andrew.McNab@cern.ch
#
total_cpu=`pbsnodes \`hostname\` | grep '^ * np = '| head -1 | sed 's/^ * np = //'`
if [ "$total_cpu" != "" ] ; then
echo $total_cpu
exit 0
fi
total_cpu=`pbsnodes \`hostname -s\` | grep '^ * np = '| head -1 | sed 's/^ * np = //'`
if [ "$total_cpu" != "" ] ; then
echo $total_cpu
exit 0
fi
for i in `hostname` `hostname -s` `hostname -f`
do
total_cpu=`pbsnodes $i | grep '^ * np = '| head -1 | sed 's/^ * np = //'`
if [ "$total_cpu" != "" ] ; then
echo $total_cpu
exit 0
fi
done
exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment