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

Trigger a script directly after partclone that requests input and copies a folder

Scheduled Pinned Locked Moved
FOG Problems
7
30
7.8k
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.
  • A
    abos_systemax
    last edited by May 10, 2016, 3:38 PM

    As far as I am aware, a snapin requires a FOG Service to run on the Windows client.
    Since this is customer hardware and FOG is only used to deploy an image; is it possible to run a script after the partclone part that requests user input and writes a file directly to disk?

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by May 10, 2016, 3:45 PM

      It’s called postdownloadscripts. Specifically this is designed to do almost EXACTLY what you want.

      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
      • A
        abos_systemax
        last edited by May 10, 2016, 3:54 PM

        I’ve seen it mentioned earlier… Is there any documentation on this subject?

        T G 2 Replies Last reply May 10, 2016, 4:02 PM Reply Quote 0
        • T
          Tom Elliott @abos_systemax
          last edited by May 10, 2016, 4:02 PM

          @abos_systemax minimal at best, but i’m certain what you’ve read about it is enough to at least get you started.

          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

          W 1 Reply Last reply May 10, 2016, 4:06 PM Reply Quote 0
          • W
            Wayne Workman @Tom Elliott
            last edited by May 10, 2016, 4:06 PM

            @Tom-Elliott can you point out what minimal stuff there is? I’d like to learn about it and improve documentation.

            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!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            T 1 Reply Last reply May 10, 2016, 4:50 PM Reply Quote 1
            • T
              Tom Elliott @Wayne Workman
              last edited by May 10, 2016, 4:50 PM

              @Wayne-Workman https://forums.fogproject.org/topic/4084/automatic-hardware-detection-driver-installs-in-fog/28

              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

              I 1 Reply Last reply May 10, 2016, 8:13 PM Reply Quote 0
              • I
                ITSolutions Testers @Tom Elliott
                last edited by May 10, 2016, 8:13 PM

                @Tom-Elliott Is there a list of what variables available to be used in the scripts? I noticed that $osid and ${postdownloadpath} were used in those scripts. Are there any others that are globally available to a post download script?

                G S 2 Replies Last reply May 10, 2016, 8:36 PM Reply Quote 0
                • G
                  george1421 Moderator @ITSolutions
                  last edited by george1421 May 11, 2016, 4:11 AM May 10, 2016, 8:36 PM

                  @ITSolutions look at Junkhacker’s post here https://forums.fogproject.org/topic/6463/expose-fog-host-and-image-properties-to-post-install-scripts/7

                  I’ve had it on my back burner to write a php page that I could call in the post download script to pickup more deploy time info that is currently listed above. There never seems to be enough time to work on it though.

                  @abos_systemax what type of input do you need from the user? I have a pretty extensive postinstall script. I haven’t tried it in a while but I was able to pause the postinstall script to wait for an IT tech’s input and then write a file based on the user’s input.

                  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!

                  1 Reply Last reply Reply Quote 2
                  • G
                    george1421 Moderator @abos_systemax
                    last edited by May 10, 2016, 8:49 PM

                    @abos_systemax I did have a sample script from my dev box (the one and only I didn’t purge about a week ago).

                    Here is the basics of the code.
                    Create a file in /images/postdownloadscripts called fog.question (you can really name it what ever you like). Then paste the content of the follow script into that file.

                    #!/bin/bash
                      . /usr/share/fog/lib/funcs.sh;
                      read -p "Enter your room number " rn
                      echo "You answered ${rn}. ";
                    

                    Now edit /images/postdownloadscripts/fog.postdownload

                    And append this line
                    . ${postdownpath}fog.question

                    Now deploy your image. After the image is deployed the installer should stop and ask you for the room number and then continue.

                    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!

                    A 1 Reply Last reply May 11, 2016, 9:37 AM Reply Quote 2
                    • S
                      Sebastian Roth Moderator @ITSolutions
                      last edited by May 11, 2016, 6:00 AM

                      @ITSolutions said:

                      Is there a list of what variables available to be used in the scripts? I noticed that $osid and ${postdownloadpath} were used in those scripts. Are there any others that are globally available to a post download script?

                      I am sure there are more. AFAIK we don’t maintain a list of those. Just put a test script in place that dumps the environment (env and set) to a text file and examine it afterwards…

                      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
                      • A
                        abos_systemax @george1421
                        last edited by May 11, 2016, 9:37 AM

                        @george1421
                        Thank you! This is exactly (well, almost exactly) what I needed.
                        The rest is just a normal Bash script I presume

                        G 1 Reply Last reply May 11, 2016, 10:08 AM Reply Quote 0
                        • G
                          george1421 Moderator @abos_systemax
                          last edited by May 11, 2016, 10:08 AM

                          @abos_systemax If you explain (in more detail) what you are trying to do (other than ask a question to the installer) I might be able to provide a better quality answer.

                          But you are correct since the post install scripts are run on the FOS (linux) client it executes as a bash script.

                          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!

                          A 1 Reply Last reply May 13, 2016, 3:47 PM Reply Quote 0
                          • A
                            abos_systemax @george1421
                            last edited by May 13, 2016, 3:47 PM

                            @george1421 At my company we deploy for multiple customers; I want to echo a script to the 😄 drive of the just deployed machine that contains the computername that we have decided for the machine. Since we are unable to use the FOG Client on Windows (not our devices, nor our images), I have to find other ways.

                            Your script seems to work, with one problem: I cannot type anything. The same problem occurs when I run a Debug Deployment; the FOS doesn’t seem to recognize my keyboard on a Fujitsu E546.

                            G A 2 Replies Last reply May 13, 2016, 3:55 PM Reply Quote 0
                            • G
                              george1421 Moderator @abos_systemax
                              last edited by george1421 May 13, 2016, 9:59 AM May 13, 2016, 3:55 PM

                              @abos_systemax As for the keyboard issue, I can not help you with that other than can you use an external keyboard?

                              For the system renaming. I don’t use the fog client for that either. In my case we use an unattend.xml file as part of the sysprep process. We update the unattend.xml file in the fog post install scripts with the computer name and other relevant install time settings.

                              I use the following command in my post install script. The variable $compname is calculated based on the target computer asset tag and install location. In your case the $compname variable would be set based on the question/answer you provided. Depending on where you place the unattend.xml file you need to provide the full path and filename of the unattend.xml file (Reminder: pay attention to the case of the file and path)

                              sed -i -e "s#<ComputerName>\([^<][^<]*\)</ComputerName>#<ComputerName>$compname</ComputerName>#gi" $PathToUnattendFile

                              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!

                              1 Reply Last reply Reply Quote 2
                              • A
                                abos_systemax @abos_systemax
                                last edited by May 13, 2016, 4:22 PM

                                @abos_systemax said in Trigger a script directly after partclone that requests input and copies a folder:

                                @george1421 At my company we deploy for multiple customers; I want to echo a script to the 😄 drive of the just deployed machine that contains the computername that we have decided for the machine. Since we are unable to use the FOG Client on Windows (not our devices, nor our images), I have to find other ways.

                                Your script seems to work, with one problem: I cannot type anything. The same problem occurs when I run a Debug Deployment; the FOS doesn’t seem to recognize my keyboard on a Fujitsu E546.

                                it does work with an external keyboard…
                                is that a driver related issue?

                                1 Reply Last reply Reply Quote 0
                                • JunkhackerJ
                                  Junkhacker Developer
                                  last edited by May 13, 2016, 4:24 PM

                                  it does work with an external keyboard…
                                  is that a driver related issue?

                                  almost certainly, yes.
                                  personally, i’d just use an external keyboard instead of troubleshooting further…

                                  signature:
                                  Junkhacker
                                  We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                                  G 1 Reply Last reply May 13, 2016, 4:44 PM Reply Quote 1
                                  • G
                                    george1421 Moderator @Junkhacker
                                    last edited by May 13, 2016, 4:44 PM

                                    @Junkhacker said

                                    almost certainly, yes.
                                    personally, i’d just use an external keyboard instead of troubleshooting further…

                                    I agree, you only need the external keyboard for deployment. Once the windows kernel boots then the onboard keyboard should work.

                                    You have to remember that the FOG system (FOS client specifically) is linux based. So its may not be possible to have every flavor of driver possible. I suspect that the keyboard is connected behind some kind of onboard controller that linux doesn’t support.

                                    To restate what @Junkhacker just posted, go ahead and use an external keyboard for deployment, then move on to the next issue.

                                    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!

                                    A 1 Reply Last reply May 14, 2016, 1:56 PM Reply Quote 0
                                    • A
                                      abos_systemax @george1421
                                      last edited by May 14, 2016, 1:56 PM

                                      @george1421 said in Trigger a script directly after partclone that requests input and copies a folder:

                                      @Junkhacker said

                                      almost certainly, yes.
                                      personally, i’d just use an external keyboard instead of troubleshooting further…

                                      I agree, you only need the external keyboard for deployment. Once the windows kernel boots then the onboard keyboard should work.

                                      You have to remember that the FOG system (FOS client specifically) is linux based. So its may not be possible to have every flavor of driver possible. I suspect that the keyboard is connected behind some kind of onboard controller that linux doesn’t support.

                                      To restate what @Junkhacker just posted, go ahead and use an external keyboard for deployment, then move on to the next issue.

                                      Yes. The only problem is that I will have 1000ths of laptops that have to be deployed. But that is my problem; I get that the problem is a driver related issue; I think I’ll have to use variables and good’ol mySQL to automate the process instead of typing a computername.

                                      I thank you all for replying; I now know how to actually trigger a script; All I need to figure out now is the automation part.

                                      -Alex

                                      G T 2 Replies Last reply May 14, 2016, 2:02 PM Reply Quote 0
                                      • G
                                        george1421 Moderator @abos_systemax
                                        last edited by george1421 May 14, 2016, 8:03 AM May 14, 2016, 2:02 PM

                                        @abos_systemax If you have that many systems I would take a slightly different approach but still within the framework of FOG.

                                        If you have 1000 systems and have them cataloged (system name and mac address), you can import those systems into fog as hosts. This catalog can come from any tool that can create a .csv file. So you could use excel to create a table of your systems (computer name vs mac address). Upload them into FOG and then create a post install script that takes fog post install variable $hostname and insert that into the sed script (instead of $compname)I posted before. This way no mysql queries are needed, everything is in FOG and you are using the resources provided by FOG for imaging. You still are not using the fog client for anything. You are just updating the unattend.xml with the value (indirectly) from your csv upload.

                                        The other option is to just let fog create an auto number of the systems are they are registered, like nc0001 for the first system, nc0002 for the second and so on.

                                        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!

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          Tom Elliott @abos_systemax
                                          last edited by May 14, 2016, 6:50 PM

                                          @abos_systemax is the only reason you want to trigger a script so you can have the user define the hostname? There is already a way to automate setting up a hostname for the system within fog. Assuming you do register the systems you could use auto population to at least help with the naming part by itself.

                                          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

                                          A 1 Reply Last reply May 17, 2016, 2:18 PM Reply Quote 1
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            2/30
                                            Last post

                                          158

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project