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

    Provision with Script

    Scheduled Pinned Locked Moved Solved
    Feature Request
    4
    33
    6.2k
    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.
    • george1421G
      george1421 Moderator @zfeng
      last edited by

      @zfeng Of course that assumes you are installing linux on a target computer. If it was a windows OS on the target computer we still could do something similar you would just have to change how the script or PS was launched by updating the windows registry for run once with a FOS Linux post install 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!

      JunkhackerJ 1 Reply Last reply Reply Quote 0
      • JunkhackerJ
        Junkhacker Developer @george1421
        last edited by

        or run the script with the fog client as a snapin

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

        Z 1 Reply Last reply Reply Quote 0
        • Z
          zfeng @george1421
          last edited by

          @george1421 Thing is getting more clear. However, I still need some help. The reason why I need run script every time after I provision the computer is because with different computer I need to download different stuff for the different computer. Let’s say that I have computerA and computerB that I need to provision. How can I possibly specify argument with script, such as, Computer=ComputerA ./script.sh on the home directory?

          JunkhackerJ 1 Reply Last reply Reply Quote 0
          • Z
            zfeng @Junkhacker
            last edited by

            @Junkhacker can I run that on the home directory after the computer finishes provisioning? Thanks for jumping in

            JunkhackerJ 1 Reply Last reply Reply Quote 0
            • JunkhackerJ
              Junkhacker Developer @zfeng
              last edited by

              @zfeng variables such as the host name are available for use scripting within FOS. this info comes from the host’s profile that gets created when you register a host with FOG.

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

              Z 1 Reply Last reply Reply Quote 0
              • JunkhackerJ
                Junkhacker Developer @zfeng
                last edited by

                @zfeng if you give some more info on what the script is actually doing, we might be able to help you find the best solution faster

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

                Z 1 Reply Last reply Reply Quote 0
                • Z
                  zfeng @Junkhacker
                  last edited by

                  @Junkhacker hostname is part of the script. I also need to do something else such as downloading a particular file with specific variable passed from the argument

                  JunkhackerJ 1 Reply Last reply Reply Quote 0
                  • JunkhackerJ
                    Junkhacker Developer @zfeng
                    last edited by

                    @zfeng this is very vague

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

                    Z 1 Reply Last reply Reply Quote 0
                    • Z
                      zfeng @Junkhacker
                      last edited by

                      @Junkhacker the script will install different projects from git repository. everyone of the them needs to have an argument to install specific package on the computer.

                      For now, after I complete the provision part, I basically power up the computer and run Computer=ComputerA ./start.sh on the home directory.

                      1 Reply Last reply Reply Quote 0
                      • Z
                        zfeng @Junkhacker
                        last edited by

                        @Junkhacker I am sorry for not specific enough

                        Tom ElliottT JunkhackerJ 2 Replies Last reply Reply Quote 0
                        • Tom ElliottT
                          Tom Elliott @zfeng
                          last edited by

                          @zfeng I’m guessing the image is Linux based?

                          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

                          Z 1 Reply Last reply Reply Quote 0
                          • Z
                            zfeng @Tom Elliott
                            last edited by

                            @Tom-Elliott Yes. You guys are very responsive. I appreciate that

                            1 Reply Last reply Reply Quote 0
                            • JunkhackerJ
                              Junkhacker Developer @zfeng
                              last edited by

                              @zfeng it sounds like George’s method of creating a file in /etc/init.d on the target disk would work well for you. you can find info on creating postdownload scripts by searching on the forums

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

                              Z 1 Reply Last reply Reply Quote 1
                              • Z
                                zfeng @Junkhacker
                                last edited by

                                @Junkhacker but how can I pass the argument to that script?

                                Tom ElliottT JunkhackerJ 2 Replies Last reply Reply Quote 0
                                • Tom ElliottT
                                  Tom Elliott @zfeng
                                  last edited by

                                  @zfeng so if you use post download script you could auto set your start script to have the host name preset

                                  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

                                  Z 1 Reply Last reply Reply Quote 0
                                  • JunkhackerJ
                                    Junkhacker Developer @zfeng
                                    last edited by

                                    @zfeng you could do something like wget -o /root/script.sh <address>/script.sh; echo “Computer=$hostname /root/script.sh” > <drive mount point>/etc/init.d/oneshot.sh

                                    something like that.

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

                                    Z 1 Reply Last reply Reply Quote 1
                                    • Z
                                      zfeng @Tom Elliott
                                      last edited by

                                      @Tom-Elliott The best thing I can do now is to try out that, and see what comes. Let’s say I need provision a linux computer with script Computer=ComputerA ./start.sh on the home directory. Is there any instruction I can try that out?

                                      1 Reply Last reply Reply Quote 0
                                      • Z
                                        zfeng @Junkhacker
                                        last edited by

                                        @Junkhacker where should I specify wget -o /root/script.sh <address>/script.sh; echo “Computer=$hostname /root/script.sh” > <drive mount point>/etc/init.d/oneshot.sh command?

                                        JunkhackerJ 1 Reply Last reply Reply Quote 0
                                        • JunkhackerJ
                                          Junkhacker Developer @zfeng
                                          last edited by

                                          @zfeng in a postdownload script, so that it will run when the imaging process completes but before the imaging task completes

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

                                          Z 1 Reply Last reply Reply Quote 1
                                          • george1421G
                                            george1421 Moderator
                                            last edited by george1421

                                            If you search the tutorials FOG forum I have several on creating postdown scipts to install model specific drivers (for windows). The concepts are the same for what you want to do. You will just mount the target computer’s linux root volume. https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

                                            https://forums.fogproject.org/topic/9463/fog-postinit-scripts-before-the-magic-begins

                                            and from here: https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script/4

                                            These are the list of FOG variables that are available to postdownload scripts.

                                            shutdown	# Shut down at the end of imaging
                                            hostdesc	#Host Description from Host Managment-General
                                            hostip		# IP address of the FOS client
                                            hostimageid	# ID of image being deployed
                                            hostbuilding	# ??
                                            hostusead	# Join Domain after image task from Host Management-Active Directory
                                            hostaddomain	# Domain name from Host Management-Active Directory
                                            hostaduser	# Domain Username from Host Management-Active Directory
                                            hostadou	# Organizational Unit from Host Management-Active Directory
                                            hostproductkey=	# Host Product Key from Host Management-Active Directory
                                            imagename	# Image Name from Image Management-General
                                            imagedesc	# Image Description from Image Management-General
                                            imageosid	# Operating System from Image Management-General
                                            imagepath	# Image Path from Image Management-General (/images/ assumed)
                                            primaryuser	# Primary User from Host Management-Inventory
                                            othertag	# Other Tag #1 User from Host Management-Inventory
                                            othertag1	# Other Tag #2 from Host Management-Inventory
                                            sysman		# System Manufacturer from Host Management-Inventory (from SMBIOS)
                                            sysproduct	# System Product from Host Management-Inventory (from SMBIOS)
                                            sysserial	# System Serial Number from Host Management-Inventory (from SMBIOS)
                                            mbman		# Motherboard Manufacturer from Host Management-Inventory (from SMBIOS)
                                            mbserial	# Motherboard Serial Number from Host Management-Inventory (from SMBIOS)
                                            mbasset		# Motherboard Asset Tag from Host Management-Inventory (from SMBIOS)
                                            mbproductname	# Motherboard Product Name from Host Management-Inventory (from SMBIOS)
                                            caseman		# Chassis Manufacturer from Host Management-Inventory (from SMBIOS)
                                            caseserial	# Chassis Serial from Host Management-Inventory (from SMBIOS)
                                            caseasset	# Chassis Asset from Host Management-Inventory (from SMBIOS)
                                            location	# Host Location (name) from Host Management-General
                                            

                                            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
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            208

                                            Online

                                            12.1k

                                            Users

                                            17.3k

                                            Topics

                                            155.3k

                                            Posts
                                            Copyright © 2012-2024 FOG Project