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

    FOG Post Deploy Script Rename Host (Linux)

    Linux Problems
    2
    3
    121
    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.
    • W
      WT_101 last edited by

      Hi

      Below are my post install script. Im trying to change the hostname for ubuntu desktop image but it is not taking effect. I’m using virtual box to trying out my script. May i know which part of my script having problem?

      . /usr/share/fog/lib/funcs.sh
      #########################################################
      # Functions
      #########################################################
      FUNC_DOTS() {
          max=65
          if [ -n "$1" ]; then
      		n=`expr $max - ${#1}`
      		echo -n " * ${1:0:max}"
      		if [ "$n" -gt 0 ]; then
      			for i in $(seq $n); do
      				printf %s .
      			done
      		fi
      	fi
      }
      
      #########################################################
      # Update hostname file
      #########################################################
      FUNC_DOTS "Updating /etc/hostname"
      echo $hostname
      echo $hostname >/etc/hostname
      echo "Done"
      
      1 Reply Last reply Reply Quote 0
      • george1421
        george1421 Moderator @WT_101 last edited by george1421

        @wt_101 If I can suggest you look at this post: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

        it gives you an idea how to do this with windows. You can use the same concept, except for maybe look for the partition that has an /etc directory.

        Here is a bit older script that shows a few different techniques. https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-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!

        1 Reply Last reply Reply Quote 1
        • W
          WT_101 last edited by

          I have found the problem which i missing out of the below segment connecting my drive. After adding below script it is working fine.

          Currently i find the disk “/dev/sda5” during my partclone deploy screen and paste into above code.

          osdiskpart="/dev/sda5";
          mkdir /ntfs 2>/dev/null
          mount "${osdiskpart}" /ntfs 2>/tmp/mntfail
          

          This raise another question on “/dev/sda5” where can i get the osdiskpart based on the images so that i do not need to hardcode into my post deploy script?

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

          132
          Online

          10.4k
          Users

          16.4k
          Topics

          150.6k
          Posts

          Copyright © 2012-2023 FOG Project