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

    fog.man.reg in 1.5.0. RC9

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    2
    4
    708
    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.
    • J
      JGallo
      last edited by

      Server
      • FOG Version: 1.5.0 RC9
      • OS:
      Client
      • Service Version:
      • OS:
      Description

      Hello all,

      I’ve been tinkering between 1.5.0 RC7 - RC9 and noticed that my custom fog.man.reg file no longer works on RC9. It works fine on RC7 but after going to RC9 the postinitscript works it’s just my custom fog.man.reg file no longer operates like it use to.

      https://forums.fogproject.org/topic/9851/custom-full-host-registration-menu-for-1-4-0-rc2-and-later

      I posted this some time ago and doesn’t look like it works. Has the fog.man.reg file changed in RC9 vs RC7?

      I suspect it has to do with the following part of the code in fog.man.reg:

      setIDs() {
          local varVar="$1"
          local str="$2"
          local csvstyle="$3"
          local dummy="$4"
          local max="$5"
          local res=""
          local url=""
          local oIFS=$IFS
          local line=""
          while [[ -z ${!varVar} ]]; do
              [[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n "    Enter the $str IDs separated with , to associate with computer (? for listing): " || echo -n "    Enter the $str ID to associate with computer (? for listing): "
              read dummy
              dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
              case $dummy in
                  [?])
                      url="http://${web}service/${str}listing.php"
                      clearScreen
                      res=$(echo -e $(curl -ks $url 2>/dev/null))
                      i=0
                      IFS=$'\n'
                      for line in $res; do
                          let i+=1
                          echo $line
                          if [[ $i -eq $max ]]; then
                              [[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n "    Press [Enter] to proceed or enter the $str IDs separated with , to associate with computer: " || echo -n "    Press [Enter] to proceed or enter the $str ID to associate with computer: "
                              read dummy
                              case $dummy in
                                  [?]|"")
                                      i=0
                                      clearScreen
                                      continue
                                      ;;
                              esac
                              case $csvstyle in
                                  [Tt][Rr][Uu][Ee])
                                      [[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
                                      break
                                      ;;
                                  *)
                                      [[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
                                      break
                                      ;;
                              esac
                              i=0
                              dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
                              clearScreen
                          fi
                      done
                      ;;
                  ""|0)
                      printf -v "$varVar" 0
                      ;;
                  *)
                      dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
                      [[ -z $dummy ]] && setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
                      case $csvstyle in
                          [Tt][Rr][Uu][Ee])
                              [[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
                              ;;
                          *)
                              [[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
                              ;;
                      esac
                      ;;
              esac
          done
          IFS=$oIFS
      }
      

      When I go to enter ? to list the image ID’s the response I get is blank with the same question being asked as if nothing exists even though I have images on the server. This also goes for the location plug in where it asks for the location ID. Is there a different way to handle this now? Should I be patching a different file with the postinscripts in RC9 instead of the fog.man.reg? Thank you.

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        Change the curl lines in the file. Change in particular on the curl lines http://${web}... to just ${web}...

        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

        J 2 Replies Last reply Reply Quote 0
        • J
          JGallo @Tom Elliott
          last edited by

          @tom-elliott

          I thought I did that. I will double check again.

          1 Reply Last reply Reply Quote 0
          • J
            JGallo @Tom Elliott
            last edited by

            @tom-elliott said in fog.man.reg in 1.5.0. RC9:

            http://${web}… to just ${web}…

            Well I feel dumb. Missed one. Confirmed and that works. Thank you once again.

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

            157

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project