SOLVED Full Reg mod - postinit script issue.

  • 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/bash^M: bad interpreter: no file/dir
    and reboots…

    seems like it’s deleting the 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

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

    cp -f ${postinitpath} /bin/ is from this link
    Get the same error using my edited copy or the original.

  • @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…

  • Moderator

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

    /bin/fog: /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 : Use this utility to scrub your 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.

  • Senior Developer

    @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).