Reply To: Big problems from a small bug in v2.31

Max2Play Home Forums Max2Play on Raspberry PI Big problems from a small bug in v2.31 Reply To: Big problems from a small bug in v2.31

7. Juli 2016 at 15:27 #21287

@flysurfer:
Thanks for the compliments and I’d be interested in participating more. Let me know what the plans are and we’ll see what happens. You can also email me directly on the address I’m registered with.

Now on the hosts/hostname bug:
It looks like the patch isn’t working yet. Martin reported it here and after trying it myself I had a look at the code.
My PHP-foo is quite rusty as I’m a Perl guy myself but here’s what I found:

The part that is generating the „sed“ command looks like this:
'sed -i \'s/'.$this->getHostname($this->view->playername).' '.$this->view->playername.'/'.$this->getHostname($name).' '.$name.'/\' /etc/hosts'

Which resolves into:
sed -i 's/max2play max2play/livingroom livingroom/' /etc/hosts

… and that doesn’t do much on an /etc/hosts file that looks like this on a default install:

pi@max2play:~ $ cat /etc/hosts
127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	max2play

I think I understand where the need for the addition of getHostname comes from but my guess is that it was written in a dev environment where /etc/hosts may have looked like this:

127.0.0.1	localhost max2play
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

Hope this helps.

Cheers,
OneArmedBandit