• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

PostDownloadScript Question

Scheduled Pinned Locked Moved
General Problems
2
6
930
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    FlareImp
    last edited by Apr 23, 2018, 3:40 PM

    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,

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Apr 23, 2018, 4:45 PM

      Assuming you name your images appropriately, you can use the $img variable to direct which files to copy for which image is being applied.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • T
        Tom Elliott
        last edited by Apr 23, 2018, 4:46 PM

        Similarly you could use the $osid variable which determines your OS implicitly rather than relying on the image name.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        F 1 Reply Last reply Apr 23, 2018, 7:28 PM Reply Quote 0
        • F
          FlareImp @Tom Elliott
          last edited by Apr 23, 2018, 7:28 PM

          @tom-elliott Okay, so would it look something like this?

          if [osid=win7] 
          then
          rsync ****
          fi
          

          Sorry for the Noob question.

          T 1 Reply Last reply Apr 24, 2018, 1:11 AM Reply Quote 0
          • T
            Tom Elliott @FlareImp
            last edited by Apr 24, 2018, 1:11 AM

            @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.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            F 1 Reply Last reply Apr 24, 2018, 1:49 PM Reply Quote 0
            • F
              FlareImp @Tom Elliott
              last edited by Apr 24, 2018, 1:49 PM

              @tom-elliott Awesome, working like a charm, thank you.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                1/6
                Last post

              233

              Online

              12.1k

              Users

              17.3k

              Topics

              155.3k

              Posts
              Copyright © 2012-2024 FOG Project