Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 90 lines (89 sloc) 1.55 KB
#!/bin/bash
. /usr/share/fog/lib/funcs.sh
clearScreen
displayBanner
disks=""
disk=""
hd=""
sysman=""
sysproduct=""
sysversion=""
sysserial=""
sysuuid=""
systype=""
biosversion=""
biosvendor=""
biosdate=""
mbman=""
mbproductname=""
mbversion=""
mbserial=""
mbasset=""
cpuman=""
cpuversion=""
cpucurrent=""
cpumax=""
mem=""
hdinfo=""
caseman=""
casever=""
caseserial=""
caseasset=""
sysman64=""
sysproduct64=""
sysversion64=""
sysserial64=""
sysuuid64=""
systype64=""
biosversion64=""
biosvendor64=""
biosdate64=""
mbman64=""
mbproductname64=""
mbversion64=""
mbserial64=""
mbasset64=""
cpuman64=""
cpuversion64=""
cpucurrent64=""
cpumax64=""
mem64=""
hdinfo64=""
caseman64=""
casever64=""
caseserial64=""
caseasset64=""
dots "Using disk device"
getHardDisk
echo "$hd"
echo "Starting host registration"
debugPause
mac=$(getMACAddresses | base64)
sysuuid=$(dmidecode -s system-uuid)
sysuuid=${sysuuid,,}
sysuuid=$(echo $sysuuid | base64)
dots "Attempting to register host"
count=0
res=""
productKey=""
if [[ -f /sys/firmware/acpi/tables/MSDM ]]; then
productKey=$(tail -c+57 /sys/firmware/acpi/tables/MSDM | base64)
fi
while [[ -z $res ]]; do
res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&productKey=${productKey}" ${web}service/auto.register.php 2>/dev/null)
case $count in
[0-8])
let count+=1
usleep 5000000
;;
9)
echo "Failed"
debugPause
handleError "Cannot register host. ($0)\n Args Passed: $*"
;;
esac
done
echo "$res"
debugPause
. /bin/fog.inventory
count=0
You can’t perform that action at this time.