• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. lenels2eng
    3. Best
    L
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 18
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by lenels2eng

    • RE: Hardware Agnostic Mobile FOG

      @george1421 IT WORKS!!! (at least on the first system I tried šŸ˜› )

      so your code is MUCH more elegant than mine but it works.

      Here is what I did to the script:

      1. I implemented a check on the interface using the code you started me on (like your code you just shared).
      2. I created an SQL update statement that updates two tables in the fog database:
      # If the interface from fogsettings doesn't match what the system returned #
      #    Make the change so system can still function #
      #---- Update the interface Setting ----#
      $echo "The interface does not match the interface setting in $fogsettings, updating the interface Settings server-wide." >> $log
      statement3="UPDATE \`globalSettings\` SET \`settingValue\`='$interface' WHERE \`settingKey\` IN ('FOG_NFS_ETH_MONITOR','FOG_UDPCAST_INTERFACE');"
      statement4="UPDATE \`nfsGroupMembers\` SET \`ngmInterface\`='$interface' WHERE \`ngmMemberName\`='$storageNode' OR \`ngmHostname\`='$ipaddress';"
      sqlStatements2="$statement3$statement4"
      
      
      1. adjusted the SQL execution to add in the new SQL statements:
      # Builds proper SQL Statement and runs.
      # If no user defined, assume root
      [[ -z $snmysqluser ]] && $snmysqluser='root'
      # If no host defined, assume localhost/127.0.0.1
      [[ -z $snmysqlhost ]] && $snmysqlhost='127.0.0.1'
      # No password set, run statement without pass authentication
      if [[ -z $snmysqlpass ]]; then
          $echo "A password was not set in $fogsettings for mysql use" >> $log
          $mysql -u"$snmysqluser" -e "$sqlStatements" "$database" 2>> $log
          $mysql -u"$snmysqluser" -e "$sqlStatements2" "$database" 2>> $log
          # Else run with password authentication
      else
          $echo "A password was set in $fogsettings for mysql use" >> $log
          $mysql -u"$snmysqluser" -p"${snmysqlpass}" -e "$sqlStatements" "$database" 2>> $log
          $mysql -u"$snmysqluser" -p"${snmysqlpass}" -e "$sqlStatements2" "$database" 2>> $log
      fi
      
      

      4)updated the .ogsettings file to edit the interface entry:

      #---- Update .fogsettings IP ----#
      $echo "Updating the ipaddress field inside of $fogsettings" >> $log
      $sed -i "s|ipaddress='.*'|ipaddress='$ip'|g" $fogsettings
      $sed -i "s|interface='.*'|interface='$interface'|g" $fogsettings
      
      

      Rebooted and opened the beb interface. All looks good!!!

      Now, I just need to make/capture an image to prove all is working.

      Thanks!!!

      posted in FOG Problems
      L
      lenels2eng
    • RE: Hardware Agnostic Mobile FOG

      I have been paying with this for a bit now and was working through a scenario where the OS doesn’t get an IP so trying to statically assign one, at least temporarily. I wasn’t able to get it to work but I think it just needs a little more time to work on this scenario. Otherwise, this works quite well. I did some minor tweaks so that my end user only had to boot to the USB drive and after the cron job runs keep an eye on the screen for the IP of the FOG server which I echo’ed out at the end of the script using: printf ā€œThe IP of the FOG server is: $IP \Nā€ > /dev/console

      I sent it off to a co-worker in another location and asked them to just plug in the USB drive, boot to it, wait for the message then try another machine to see if he got the FOG menu. He did and was able to register the machine with FOG and pull an image down so I’m marking this:

      SOLVED!!!

      I may try to go back when I have some time to finish hashing through the statically assign an IP if you don’t get one scenario…

      posted in FOG Problems
      L
      lenels2eng
    • 1 / 1