Question(s) about fog.updateunattend post download script
-
Hi all,
I’m working on integrating an AD join for newly imaged systems using the fog.updateunattend example script found in the holy scripture.
I see some of the variables used in the script aren’t defined, so I’m curious as to where there definitions come from. Specifically, $aduser, $adou, and $addomain
Are these values assumed to already be in the unattend file prior to dynamically updating the hostname? Or is there something I am missing here?
I’m assuming those variables should be defined at the start of the script otherwise…
Anyone using this script or a derivative in production?
Thanks,
the bofh
-
@bofh There is a prequel article to the one you linked with a lot of useful information here: https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script
More to your point FOG preloads some variables into the post install script environment for use. At the bottom of the tutorial linked above I show how to uses a curl call to grab more values if needed.
If you want to see what variables are available during the post install script you can do a little bit of hacking to get your answer.
In the fog.postdownload script add in the following lines at the end of the script as delivered from FOG.
echo "Hey I'm about to run a post install script, please stop me" debugPause
Now schedule a debug deployment. Just before you hit the schedule task button tick the debug checkbox.
Now pxe boot the target computer. After several screens of text you need to clear with the enter key you will be dropped to the fos linux command prompt. At the fos linux command prompt key in
fog
to start imaging in single step mode. When you see the “Hey I’m about to run a post install script…” press ctrl-C. This is the environment where you post install script would run. Key inset |more
to see the variables available to you. -
@george1421 Thank you so much! That article helped immensely.