Manual Register then straight to imaging
-
Greetings!
I am attempting to have a Manual Registration into FOG and then, without rebooting, go straight into the imaging process. Or as close to that as mechanically possible.I have found the awesome thread located here: Forum Post
From that link I was given hope. However, after rereading the article a dozen times, i’m obviously just not picking up on something. And so, I am asking for another pair of eyes in my FOG.MAN.REG to see what i am doing wrong. Please , and thank you.
FOG.MAN.REG last few lines below.
dots "Attempting to register host" res="" while [[ -z $res ]]; do res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" ${web}service/auto.register.php 2>/dev/null) echo "$res" usleep 2000000 done . /bin/fog.inventory sysuuid=$(dmidecode -s system-uuid) sysuuid=${sysuuid,,} mac=$(getMACAddresses) curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac""${web}service/hostinfo.php" -A '' [[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt . /bin/fog.download usleep 2000000
The error I am getting is below:
Thank you for any assistance you can provide.
-
@Tom-Elliott thank you for your response. Oddly enough, if I remove the lines listed below, it does the inventory task and then reboots as an out-of-the-box FOG install is expected:
sysuuid=$(dmidecode -s system-uuid) sysuuid=${sysuuid,,} mac=$(getMACAddresses) curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac""${web}service/hostinfo.php" -A '' [[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt . /bin/fog.download usleep 2000000
-
@dsutton2001 It look slike the /tmp/hinfo.txt isn’t returning the os variable?
Might need the hostinfo.php file adjusted if this is missing that labelling.
Otherwise this should work just fine.
https://github.com/FOGProject/fogproject/blob/master/packages/web/service/hostinfo.php
Assumign the imageID you’re setting actually exists, this script you have should work just fine.
-
@Tom-Elliott thank you for your response. Oddly enough, if I remove the lines listed below, it does the inventory task and then reboots as an out-of-the-box FOG install is expected:
sysuuid=$(dmidecode -s system-uuid) sysuuid=${sysuuid,,} mac=$(getMACAddresses) curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac""${web}service/hostinfo.php" -A '' [[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt . /bin/fog.download usleep 2000000
-
-
@dsutton2001 said in Manual Register then straight to imaging:
curl -Lks -o /tmp/hinfo.txt --data “sysuuid=${sysuuid}&mac=$mac”“${web}service/hostinfo.php” -A ‘’
Along with what Tom mention the above line on the surface looks suspicious. The back to back double quotes look out of place.
-
@dsutton2001 That line in question was copied from here: https://github.com/FOGProject/fos/blob/45ba692315f6e5857c12d933ae2c9c4dd5c35778/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog#L8
Its possible that the curl command or the php page is not working as it should. That php page is only used when you usb boot into fog to pick up the imaging bits.
If you want to debug this I can give you some places to look.
-
-
it was the hostinfo.php file. I copy and pasted from the link you provided into a new file after renaming the old one. Rebooted the fog server while nudging the edge of the case with a baseball bat, and it certainly wasn’t the bat. great solution. thank you!