PostDownloadScript Question
-
This isn’t so much of a problem as it is me just not being that familiar with scripting. I have my postdownloadscript setup to copy Drivers and specific programs but we are moving to Windows 10 While still using windows 7 in some cases. We want to to keep office 2013 installed on Win7 and Office 2016 on win10. How would I write my script to check the OS version so it knows what Office files to copy to the client from the fog server?
Thanks,
-
Assuming you name your images appropriately, you can use the
$img
variable to direct which files to copy for which image is being applied. -
Similarly you could use the
$osid
variable which determines your OS implicitly rather than relying on the image name. -
@tom-elliott Okay, so would it look something like this?
if [osid=win7] then rsync **** fi
Sorry for the Noob question.
-
@flareimp more like:
if [[ $osid -eq 5 ]]; then rsync **** fi
Of course if you’re planning on dealing with multiple OS’, then something like:
case $osid in # Windows 2000/XP 1) rsync **** ;; #Windows Vista 2) rsync **** ;; #Windows 98 3) rsync **** ;; # Windows Other 4) rsync **** ;; # Windows 7 5) rsync **** ;; # Windows 8 6) rsync **** ;; # Windows 8.1 7) rsync **** ;; # Apple 8) rsync **** ;; # Windows 10 9) rsync **** ;; # Linux 50) rsync **** ;; # Chromium OS 51) rsync **** ;; # Other 99) rsync **** ;; esac
Of course you will likely have less choices to make but this is a list of all the current OS id’s fog has natively in 1.5.2.
-
@tom-elliott Awesome, working like a charm, thank you.