@wayne-workman said in Resetting the Image numbers r4602:
SELECT imageID FROM images ORDER BY imageID LIMIT 1;
Can I just say thank you for this.
@wayne-workman said in Resetting the Image numbers r4602:
SELECT imageID FROM images ORDER BY imageID LIMIT 1;
Can I just say thank you for this.
@george1421 Just thinking out of the box here, and I understand I might be barking up the wrong tree, but could something like this work ?
https://linux.die.net/man/1/hivexsh
Would it then be possible to install this in fog and use this a function ?
As from there I should be able to pull the Windows version out from the registry, in theory.
As I have said before I am still learning .
@Sebastian-Roth You would be correct in the approach . Its an image once then forget. I am not using any tool to extract just a command which assigns the value to a variable and prints it out.
I then manually input the product key into a third party tool.
Do you know of any tools that could do the trick ?
Yes I do a full registration of the host then deploy .
Good day
I am looking to automate the deployment based on the license key extracted.
I currently extract the Windows license key from the BIOS, then use 3rd party tools such as ShowKeyPlus or PID checker to determine the OS version needed for the install. I then assign the OS version to the host and deploy.
What I wanted to know is it possible to extract the license key and determine the image to be assigned to the host automatically without the manual process of using 3rd party software applications?
@Tom-Elliott Thank you for your input. I realize that i have made a mistake in the code. I am new to bash and fog in general.
The idea is to have a while loop running until an image has been assigned. Or a sort of pause before it continues. The reason being that this is being done remotely and I would be assigning the correct image to the host. I am not psychically in front of the computer. The hosts users would only select that they want an image to be deployed and not select an image to deploy.
Hope that makes sense.
So what I guess I was looking for and I do realize that this is n the wrong thread is a way inside a while loop to see if an image has been assigned before continuing on with the deployment. BTW I have modified the fog.man.reg to go straight to the fog.download and the end of the registration.
@george1421 Looking at the code, say if I wanted to extract the hostimageid and assign it to $imageid in a while loop, would the following be correct :
while [[ $imageid -le 10 ]]; do
if [[ -z "imageid"]]; then
if [[ ! -z $mac ]]; then
curl -A "" -Lkso /tmp/hinfo.sh ${web}/fog/service/hinfo.php -d "mac=$mac&hostimageid=$imageid"
if [[ -f /tmp/hinfo.sh ]]; then
. /tmp/hinfo.sh
fi
echo "Please wait"
sleep 60
fi
done
This should in theory run the while loop until a value is given to the $imageid
By any chance do you know where the determineOS function is located ?
@zaboxmaster said in Need to create a While loop on deployment for when an image has not been assigned:
@Quazz Okay so I have tried using Imageid but in the fog.man.reg, I will try this in the fog.checkin file. As osid in the fog.checkin did not work either. It just skipped through
One thing I am not sure of is how the following works,
[[ -z $deployed ]] && determineOS “$osid”
I would think that hold the key
So I tried the following
while [[ $imageid -le 10 ]]; do
if [[ -z “$imageid” ]]
then
echo “Please Wait”
sleep 60
fi
done
Sorry i really do not have the greatest bash skills. But it works but the problem is I need a way to check the variable. In the loop. This is where i get really stuck. Would a curl command to the server to check the variable work ? If so what would that command be ?
@Quazz Okay so I have tried using Imageid but in the fog.man.reg, I will try this in the fog.checkin file. As osid in the fog.checkin did not work either. It just skipped through
One thing I am not sure of is how the following works,
[[ -z $deployed ]] && determineOS “$osid”
I would think that hold the key
@Quazz Sorry it skips right past and continues. Its does not pause or wait.