Running "sudo ./raspnode.sh" fails on my system with the error message "logname: no login name", the same message that the logname command fails with. I worked around this with replacing logname in the script with $USER. Perhaps the script should use something other than logname, or have a fallback?
This is with Raspian running on a Raspberry Pi 3, Model B from CanaKit.