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

Is there a way to make the hostname question REQUIRED for the Full Host Registration questions?

Scheduled Pinned Locked Moved Solved
FOG Problems
2
6
519
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.
  • V
    vince.villarreal
    last edited by Jun 28, 2018, 3:55 PM

    People keep leaving it blank and by default it puts the MAC address as the hostname. This is bad because a computer will image and then join the domain with the MAC Address since it becomes the PC name.

    Any way to make “enter hostname” required and not allow someone to just press “enter” while leaving it blank?

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by Jun 28, 2018, 4:23 PM

      Not currently in FOG, I’m sure if you had a little bash scripting skills it could be done. Let me take a look.

      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
      • G
        george1421 Moderator
        last edited by Jun 28, 2018, 4:27 PM

        I’m not a programmer but this looks like the right spot to add that requriement.

        https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.man.reg

        Line 168.

        ...
        while [[ $res != "#!ok" ]]; do
            echo -n " * Enter hostname for this computer: "
            read host
            if [[ ${#host} -gt 15 ]]; then
                host=${host:0:15}
                echo " | Truncated to 15 characters: $host"
                usleep 2000000
            fi
            host=$(echo $host | base64)
        ->> Need to check here if blank and then loop back to ask again->>
        
            res=$(curl -Lks --data "host=$host" ${web}service/hostnameloop.php 2>/dev/null)
            [[ $res != "#!ok" ]] && echo "$res"
        done
        imageid=""
        ...
        

        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!

        V 1 Reply Last reply Jun 28, 2018, 4:49 PM Reply Quote 0
        • V
          vince.villarreal @george1421
          last edited by Jun 28, 2018, 4:49 PM

          @george1421 yea I see that. I’m not a good programmer as well. If someone knows the command, please feel free to reply within this post.

          I am going to try and google my way through this.

          G 1 Reply Last reply Jun 28, 2018, 5:27 PM Reply Quote 0
          • G
            george1421 Moderator @vince.villarreal
            last edited by george1421 Jun 28, 2018, 11:28 AM Jun 28, 2018, 5:27 PM

            @vince-villarreal

            Well I have no clue if this will work. But I modified the code using examples around it.

            while [[ $res != "#!ok" ]]; do
                host="";
                while [[ $host == "" ]]; do
                    echo -n " * Enter hostname for this computer: "
                    read host
                    if [[ ${#host} -gt 15 ]]; then
                        host=${host:0:15}
                        echo " | Truncated to 15 characters: $host"
                        usleep 2000000
                    fi
                    host=$(echo $host | base64)
                done
            
                res=$(curl -Lks --data "host=$host" ${web}service/hostnameloop.php 2>/dev/null)
                [[ $res != "#!ok" ]] && echo "$res"
            done
            

            So what good does this do you?? You might ask.

            Here is what I’m going to recommend.

            1. Download and install notepad++ (required for a happy life)
            2. Go to the page I linked below and click on the raw button in the upper left corner. This will give you just the text of the module.
            3. Copy from the web browser and paste into notepad++
            4. Make the edits I listed above. Its only 3 lines setting hosts to empty, the while and the done.
            5. Save the file as fog.man.reg
              Now here is where things get fun…
            6. Copy that file to the FOG server (you could do all of this on the fog server if it has a gui) into /images/dev/postinitscripts
            7. Now modify (I need to think about the next bit. But the idea is to “hot patch” the FOS engine to apply your custom fog.man.reg file every time FOS boots. FOG has the framework to do this. I just need to get right the first time.)

            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!

            G 1 Reply Last reply Jun 28, 2018, 5:33 PM Reply Quote 0
            • G
              george1421 Moderator @george1421
              last edited by Jun 28, 2018, 5:33 PM

              @george1421 Here is a post and a thread (with developer supplied code) that will hot patch the registration file. This thread was actually someone wanting to create a custom registration process.
              https://forums.fogproject.org/topic/9754/custom-full-host-registration-for-1-3-4/45

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

              140

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project