- FOG Version: 1.4.4
- OS: Ubuntu 16.04 Server
- Service Version: N/A
- OS: Windows 10
I am trying to use the Fog Post Download Scripts to rename my computers as they are imaged. I have created a couple of scripts taken and modified from this site, however when I copy them to the postdownloadscripts directory on the server and deploy an image the host isn’t renamed (I don’t even see any reference to the postdownload script even attempting to run). Does anything need to be enabled for these scripts to run?
I have no knowledge on how the scripting language used works so it is likely that there may be an issue with my scripts, can someone have a look over them and let me know how they look:
[[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
case $osid in
[[ ! -d /ntfs ]] && mkdir -p /ntfs
if [[ -z $hd ]]; then
handleError "Could not find hdd to use"
for part in $parts; do
dots "Mounting partition $part"
ntfs-3g -o force,rw $part /ntfs >/dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
handleError "Failed to mount $part ($0)\n Args: $*"
echo "Invalid OS"
if [ -f "$unattend" ]; then
dots "Preparing Sysprep File";
rm -f /ntfs/Windows/System32/Sysprep/Unattend.xml;
dots "Writing Computer Name";
sed -i "/ComputerName/s/*/$hostname/g" $unattend
dots "ComputerName Set To";