BonjourGrid: Resolv hostname bug when deploy condor project
[slapos.git] / slapos / recipe / bonjourgrid / template / machineinfo.sh.in
1 # This script generates a file (with the name `hostname`) of the characteristics of the machine
2
3 Mhz=`grep -i Mhz /proc/cpuinfo | cut -d : -f2 | head -1 | cut -f2 -d " "`
4 mem=`grep -i MemTotal /proc/meminfo | cut -f2 -d :`
5 Ram=`echo $mem | cut -f1 -d " "`
6 Cpu=`uname -a | cut -f3 -d " "`
7 H=`hostname`
8 Nbproc=`grep processor /proc/cpuinfo |wc -l`
9 Ip=%(ip_address)s
10 status="in execution"
11 secours="host1"
12 middleware="%(middleware)s"
13 project="%(project)s"
14
15 c="{'"MHZ"':\"$Mhz\",'"Ram"':\"$Ram\",'"Cpu"':\"$Cpu\",'"HOST"':\"$H\",'"IP"':\"$Ip\",'"STATUS"':\"$status\",'"SECOURS"':\"$secours\",'"MIDDLEWARE"':\"$middleware\",'"PROJECT"':\"$project\",}"
16
17 filename=`hostname`
18 echo $c > $filename