diff --git a/hooks/intrepid/30-disable-gettys b/hooks/intrepid/30-disable-gettys index 8b14381..333b61e 100755 --- a/hooks/intrepid/30-disable-gettys +++ b/hooks/intrepid/30-disable-gettys @@ -27,9 +27,11 @@ logMessage Script $0 starting # # Remove the links for upstart # -rm ${prefix}/etc/event.d/tty[!1] -sed -i -e s/tty1/hvc0/ ${prefix}/etc/event.d/tty1 -mv ${prefix}/etc/event.d/tty1 ${prefix}/etc/event.d/hvc0 +rm -f ${prefix}/etc/event.d/tty[!1] +[ -f ${prefix}/etc/event.d/tty1 ] && { + sed -i -e s/tty1/hvc0/ ${prefix}/etc/event.d/tty1 + mv ${prefix}/etc/event.d/tty1 ${prefix}/etc/event.d/hvc0 +} [ -f ${prefix}/etc/inittab ] && sed -i -e 's/^\([2-6].*:respawn*\)/#\1/' -e 's/^T/#\t/' -e 's/tty1$/hvc0/' ${prefix}/etc/inittab # diff --git a/hooks/karmic/30-disable-gettys b/hooks/karmic/30-disable-gettys index c471be9..6752e0c 100755 --- a/hooks/karmic/30-disable-gettys +++ b/hooks/karmic/30-disable-gettys @@ -27,9 +27,11 @@ logMessage Script $0 starting # # Remove the links for upstart # -rm ${prefix}/etc/init/tty[!1].conf -sed -i -e s/tty1/hvc0/ ${prefix}/etc/init/tty1.conf -mv ${prefix}/etc/init/tty1.conf ${prefix}/etc/init/hvc0.conf +rm -f ${prefix}/etc/init/tty[!1].conf +[ -f ${prefix}/etc/event.d/tty1 ] && { + sed -i -e s/tty1/hvc0/ ${prefix}/etc/init/tty1.conf + mv ${prefix}/etc/init/tty1.conf ${prefix}/etc/init/hvc0.conf +} [ -f ${prefix}/etc/inittab ] && sed -i -e 's/^\([2-6].*:respawn*\)/#\1/' -e 's/^T/#\t/' -e 's/tty1$/hvc0/' ${prefix}/etc/inittab #