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

    PostDownloadScript Question

    Scheduled Pinned Locked Moved
    General Problems
    2
    6
    896
    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

      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
      • Tom ElliottT
        Tom Elliott
        last edited by

        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
        • Tom ElliottT
          Tom Elliott
          last edited by

          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 Reply Quote 0
          • F
            FlareImp @Tom Elliott
            last edited by

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

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

            Sorry for the Noob question.

            Tom ElliottT 1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott @FlareImp
              last edited by

              @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 Reply Quote 0
              • F
                FlareImp @Tom Elliott
                last edited by

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

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

                159

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project