- if [ -z "${CASPERGETTY}" ]; then
- sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
- else
- sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/casper-getty%' /root/etc/inittab
- # AUTOMATIC SERIAL CONSOLE #
- defconsole=$(sed -e 's%.*console=%console=%' /proc/cmdline)
- if echo "${defconsole}" | grep -qs console=ttyS; then
- PORT=$(echo "${defconsole}" | \
- sed -e's%^console=%%' -e's%,.*%%')
- SPEED=$(echo "${defconsole}" | \
- sed -e 's%^console=ttyS[0-9]\+,%%' \
+ if [ ! -z "${CASPERGETTY}" ]; then
+ if echo "${DEFCONSOLE}" | grep -qs ttyS; then
+ # AUTOMATIC SERIAL CONSOLE #
+ PORT=$(echo "${DEFCONSOLE}" | \
+ sed -e 's%,.*%%')
+ SPEED=$(echo "${DEFCONSOLE}" | \
+ sed -e 's%ttyS[0-9]\+,%%' \