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

    Full Reg mod - postinit script issue.

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    3
    4
    274
    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.
    • S
      Snow
      last edited by

      I’m running 1.5.5 and trying to modify the full registration menu. followed the instructions in another post, but I’ve hit a snag.

      The host runs the scrooge{postinitpath}patch.fullreg from fog.postinit, then throws an error:
      /bin/fog: bin.fog.man.reg: /bin/bash^M: bad interpreter: no file/dir
      and reboots…

      seems like it’s deleting the fog.man.reg file, but not copying over the fix file?
      if I echo scrooge{postinitpath} it returns /imagesinit/dev/postinitpath
      if I replace that variable with the echo path in patch.fullreg , I get no file/dir returned and FOS boots running fog.man.reg

      I’m stuck in a loop…What stupid am I doing? let me know if there’s any more info you need.

      patch.fullreg
      hashbang/bin/bash
      cp -f ${postinitpath}fog.man.reg.fix /bin/fog.man.reg

      fog.man.reg is from this link
      https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.man.reg
      Get the same error using my edited copy or the original.

      george1421G 1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @Snow said in Full Reg mod - postinit script issue.:

        /bin/bash^M: bad interpreter

        Can you please take a picture of the script opened in an editor. Best if you could open it in VI if you know how to handle it.

        Could be two things. 1. the hashbang is not correct (should be #!/bin/bash) or 2. the file is formated with Windows line endings (<CR><LF>) and might cause trouble. I say this because I think I remember having seen this ^M in VI when there are Windows line endings in a file. You might be able to convert it using the tool dos2unix (might need to install it).

        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

        1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator @Snow
          last edited by

          @Snow said in Full Reg mod - postinit script issue.:

          /bin/fog: bin.fog.man.reg: /bin/bash^M: bad interpreter: no file/dir

          Ah someone edited that linux file with a windows text editor…

          There is a utility that you need to install on your FOG server, its called dos2unix : http://dos2unix.sourceforge.net/ Use this utility to scrub your fog.man.reg file to get rid of all of the bad stuff windows puts in there.

          Next time if you want to edit this bash script on windows use notepad++ and not windows notepad.

          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!

          S 1 Reply Last reply Reply Quote 0
          • S
            Snow @george1421
            last edited by

            @george1421 Brilliant! haha. thanks. yup, my fog server is isolated so I just copied it from my windows workstation into notepad and transferred not thinking anything of it…

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

            193

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project