I hope you mean this:
Prepare AMA0
sed 's/console=ttyAMA0,115200//; s/kgdboc=ttyAMA0,115200//' /boot/cmdline.txt > /tmp/zway_install_cmdline.txt
sed 's|[^:]*:[^:]*:respawn:/sbin/getty[^:]*ttyAMA0[^:]*||' /etc/inittab > /tmp/zway_install_inittab
if diff /boot/cmdline.txt /tmp/zway_install_cmdline.txt > /dev/null || diff /etc/inittab /tmp/zway_install_inittab > /dev/null
then
rm /tmp/zway_install_cmdline.txt /tmp/zway_install_inittab
echo "Starting Z-Way"
/etc/init.d/Z-Way start
else
echo "Preparing AMA0 interface:"
echo " removing 'console=ttyAMA0,115200' and 'kgdboc=ttyAMA0,115200' from kernel command line (/boot/cmdline.txt)"
mv /tmp/zway_install_cmdline.txt /boot/cmdline.txt
echo " removing '*:*:respawn:/sbin/getty ttyAMA0' from /etc/inittab"
mv /tmp/zway_install_inittab /etc/inittab
echo "AMA0 interface reconfigured, please restart Raspberry
I will check it in a few hours, time to get some sleep
*edit
This line console=ttyAMA0,115200' and 'kgdboc=ttyAMA0,115200 is not in /boot/cmdline.txt (=ok I think)
Is
:respawn:/sbin/getty ttyAMA0 needed in /etc.inittab? (I inserted this)
or does it need
*:respawn:/sbin/getty ttyAMA0?
or not at all?