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

FOG Post Deploy Script Rename Host (Linux)

Scheduled Pinned Locked Moved
Linux Problems
2
3
529
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 Nov 14, 2021, 11:49 AM

    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
    • W
      WT_101
      last edited by Nov 14, 2021, 2:35 PM

      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?

      G 1 Reply Last reply Nov 14, 2021, 2:58 PM Reply Quote 0
      • G
        george1421 Moderator @WT_101
        last edited by george1421 Nov 14, 2021, 9:02 AM Nov 14, 2021, 2:58 PM

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

        171

        Online

        12.0k

        Users

        17.3k

        Topics

        155.2k

        Posts
        Copyright © 2012-2024 FOG Project