#!/etc/bin/sh
#
#  Main menu, dless-Xwin toolkit v2.1, (C) 1997 Roman Dolejsi - roman@sorry.vse.cz
#
export DEFAULT=sorry.vse.cz		# default remote machine
export MOUSE=ttyS0_Microsoft		# default mouse type
export V_MON=mfsvga60			# default monitor type
export V_DAC=generic			# default video D/A converter
export TXSIZE=80x25			# default text screen size
export LANG=en				# default language
export SOUND=nas			# include sound support (no/nas/rplay)
export MAX_TTY=17			# 16 consoles (menu + 15 free)

export PATH=/etc/bin
export VCONF=/etc/conf
export MCONF=/etc/mon
export XFC=/tmp/.xconf
export TEMPM=/tmp/.tmp_$PPID
export TEMPM2=/tmp/.tmp2_$PPID
export TEMPM3=/tmp/.tmp3_$PPID

export V_OCHIP=
export V_OMEM=
export V_OMON=

echo "0 mnu" > /tmp/.tty1		# tty1 will not be available (menu)

WRK=`cat /tmp/proc/cpuinfo`
WRK1=`echo $WRK | cut -f3 -d":" | cut -f2 -d" "`
WRK2=`echo $WRK | cut -f4 -d":" | cut -f2 -d" "`
WRK3=`echo $WRK | cut -f5 -d":" | cut -f2 -d" "`
WRK4=`echo $WRK | cut -f6 -d":" | cut -f2 -d" "`
export CPUTYPE="cpu $WRK1 / model $WRK2 / type $WRK3 / stepping $WRK4"

export ETH_IP=`ifconfig eth0 | grep inet | cut -f2 -d":" | cut -f1 -d" "`
ETH_LN=`cat $VCONF/defaults | grep -v :$ETH_IP: | grep $ETH_IP`

if [ -z "$ETH_LN" ]; then
  TMP1=`echo $ETH_IP | cut -f1-3 -d":"`
  ETH_LN=`cat $VCONF/defaults | grep $TMP1`
fi
if [ -z "$ETH_LN" ]; then
  TMP1=`echo $ETH_IP | cut -f1-2 -d":"`
  ETH_LN=`cat $VCONF/defaults | grep $TMP1`
fi

TMP1=`echo "$ETH_LN" | cut -f2 -d":"`	# default language
if [ -n "$TMP1" -a -s "/etc/lang/$TMP1" ]; then
  export LANG="$TMP1"
fi
eval `cat /etc/lang/$LANG`

if [ -n "$ETH_LN" ]; then
  echo "IP: $ETH_IP..."
fi

TMP1=`echo "$ETH_LN" | cut -f3 -d":"`	# default remote server
if [ -n "$TMP1" ]; then
  export DEFAULT="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f4 -d":"`	# default mouse settings
if [ -n "$TMP1" ]; then
  export MOUSE="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f5 -d":"`	# default monitor type
if [ -n "$TMP1" -a -s "$MCONF/$TMP1" ]; then
  export V_MON="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f6 -d":"`	# default memory size
if [ -n "$TMP1" ]; then
  export V_MEM="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f7 -d":"`	# default video card
if [ -n "$TMP1" ]; then
  export V_CHIP="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f8 -d":"`	# default text screen size
if [ -n "$TMP1" ]; then
  export TXSIZE="$TMP1"
fi
TMP1=`echo "$ETH_LN" | cut -f9 -d":"`	# default sound support
if [ -n "$TMP1" ]; then
  export SOUND="$TMP1"
fi

OPTN=
CMDL="`cat /tmp/proc/cmdline`"
CMDL2=$CMDL
CMDLC=0
while [ "`echo $CMDL2 | cut -c1-5`" != "OOT_I" ]; do
  CMDL2=`echo $CMDL2 | cut -f2- -d"B"`
  CMDLC=`expr $CMDLC + 1`
done
CMDL=`echo $CMDL | cut -f1-$CMDLC -d"B"`

while [ -n "$CMDL" ]; do
  OPTN=

  if [ "`echo $CMDL | cut -c1-6`" = "opthd=" ]; then
    TMP0="`echo $CMDL | cut -f1 -d\" \" | cut -c7-`"
    TMP1=`echo $TMP0 | cut -f1 -d"/"`
    TMP2=`echo $TMP0 | cut -f2- -d"/"`
    if [ -n "`dmesg | grep $TMP1`" ]; then
      mkdir /tmp/wrkdsk
      mount -n -t msdos /dev/$TMP1 /tmp/wrkdsk
      OPTN=`cat /tmp/wrkdsk/$TMP2`
      umount -n /tmp/wrkdsk
      rmdir /tmp/wrkdsk
      echo "$TMP1: $OPTN."
    fi
  fi

  if [ "`echo $CMDL | cut -c1-6`" = "optln=" ]; then
    OPTN="`echo $CMDL | cut -c7-`"
  fi

  if [ -n "$OPTN" ]; then
    TMP1=`echo "$OPTN" | cut -f1 -d":"`	# default language
    if [ -n "$TMP1" -a -s "/etc/lang/$TMP1" ]; then
      export LANG="$TMP1"
      eval `cat /etc/lang/$LANG`
    fi
    TMP1=`echo "$OPTN" | cut -f2 -d":"`	# default remote server
    if [ -n "$TMP1" ]; then
      export DEFAULT="$TMP1"
    fi
    TMP1=`echo "$OPTN" | cut -f3 -d":"`	# default mouse settings
    if [ -n "$TMP1" ]; then
      export MOUSE="$TMP1"
    fi
    TMP1=`echo "$OPTN" | cut -f4 -d":"`	# default monitor type
    if [ -n "$TMP1" -a -s "$MCONF/$TMP1" ]; then
      export V_MON="$TMP1"
    fi
    TMP1=`echo "$OPTN" | cut -f5 -d":"`	# default memory size
    if [ -n "$TMP1" ]; then
      export V_MEM="$TMP1"
    fi
    TMP1=`echo "$OPTN" | cut -f6 -d":"`	# default video card
    if [ -n "$TMP1" ]; then
      export V_CHIP="$TMP1"
    fi
    TMP1=`echo "$OPTN" | cut -f7 -d":"`	# default text screen size
    if [ -n "$TMP1" ]; then
      export TXSIZE="$TMP1"
    fi
  fi
  CMDL2="`echo $CMDL | cut -f2- -d\" \"`"
  if [ "$CMDL2" = "$CMDL" ]; then
    CMDL=
  else
    CMDL=$CMDL2
  fi
done

if [ -z "$V_CHIP" -o -z "$V_MEM" ]; then
  export V_STR="`sp`"
  if [ -z "$V_CHIP" ]; then
    export V_CHIP="`echo $V_STR | cut -f2 -d\":\" | cut -f2- -d\"_\"`"
  fi
  if [ -z "$V_MEM" ]; then
    export V_MEM="`echo $V_STR | cut -f3 -d\":\" | cut -f2- -d\"_\"`"
  fi
  export V_DAC="`echo $V_STR | cut -f4 -d\":\" | cut -f2- -d\"_\"`"
fi

echo "$L_RCVID: $V_CHIP ($V_MEM kB)"
echo "$L_RCMON: $V_MON"
echo "$L_RCMOUS: $MOUSE"

if [ ! -d "$VCONF/$V_CHIP" ]; then
  dialog --backtitle "$L_COPY" --title "$L_UNKNHW" \
         --txts $L_DIALOG --msgbox "$L_UNKINF\n\n\
 Video: $V_CHIP\n$L_MEM: $V_MEM kB\nRamDac: $V_DAC" 9 56
  V_CHIP=Default
fi

export DFL_LANG="$LANG"; export DFL_DEFAULT="$DEFAULT"; export DFL_MOUSE="$MOUSE"; export DFL_V_MON="$V_MON"
export DFL_V_MEM="$V_MEM"; export DFL_V_CHIP="$V_CHIP"; export DFL_TXSIZE="$TXSIZE"

if [ -s "$VCONF/$V_CHIP/txconf" ]; then
  cat "$VCONF/$V_CHIP/txconf" > /tmp/txconf
else
  cat "$VCONF/Default/txconf" > /tmp/txconf
fi
cat "$VCONF/txmodes" >> /tmp/txconf
stm -t /tmp/txconf -a $TXSIZE > /dev/null
setfont /etc/fonts/`cat $VCONF/txfonts | grep $TXSIZE | cut -f1 -d"	"` 2> /dev/null

gpm -m /dev/`echo $MOUSE | cut -f1 -d"_"` -t `echo $MOUSE | cut -f2 -d"_"`

if [ -n "`dmesg | grep Sound`" ]; then		# check whether we can set up audio or not
  if [ "$SOUND" = "rplay" ]; then		# Start RPlay Audio Server
    rplayd --no-auth --no-inetd --hosts=$VCONF/rplay.hosts --connection-timeout=5 \
           --memory-cache-size=0 --cache-size=0 --audio-flush=-1 \
           --audio-match --audio-device=/dev/dsp&
  elif [ "$SOUND" = "nas" ]; then		# Start Network Audio System (NAS) server
    auvoxware -aa 1> /dev/null 2> /dev/null&
  fi
else
  SOUND=no
fi

# ---------
# show_proc
# ---------

show_proc() {

  CNTR=0
  echo -n > $TEMPM
  for TMP2 in /tmp/.tty*; do
    CNTR=`expr $CNTR + 1`
    case `cat $TMP2 | cut -f2 -d" "` in
       amx) echo -n "`echo $TMP2 | cut -f2 -d.` \"$L_PRCAMX\" " >> $TEMPM;;
       mnu) echo -n "`echo $TMP2 | cut -f2 -d.` \"$L_PRCMNU\" " >> $TEMPM;;
       tel) echo -n "`echo $TMP2 | cut -f2 -d.` \"$L_PRCTEL `cat $TMP2 | cut -f3- -d\ `\" " >> $TEMPM;;
      xdsk) echo -n "`echo $TMP2 | cut -f2 -d.` \"$L_PRCDSK `cat $TMP2 | cut -f4 -d\ `bit, `cat $TMP2 | cut -f3 -d\ `\" " >> $TEMPM;;
      xlog) echo -n "`echo $TMP2 | cut -f2 -d.` \"$L_PRCLOG\" " >> $TEMPM;;
    esac
  done
  TMP1=$CNTR
  TXSIZY=`echo $TXSIZE | cut -f2 -d"x"`
  if [ "$CNTR" -gt "`expr $TXSIZY - 19`" ]; then
    TMP1=`expr $TXSIZY - 19`
  fi
  if [ "$CNTR" -lt 2 ]; then
    dialog --backtitle "$L_COPY" --title "$L_PROC" --txts $L_DIALOG \
           --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
           --btext "$CPUTYPE" -1 -1 --msgbox "$L_PROCNO" 5 40
  else
    echo "dialog --backtitle \"$L_COPY\" --title \"$L_PROC\" --txts $L_DIALOG \
                 --btext \"$ETH_IP, $LANG, $DEFAULT, $MOUSE\" 2 -2 --btext \"$V_MON, $V_MEM, $V_CHIP, $TXSIZE\" 3 -2 \
                 --btext \"$CPUTYPE\" -1 -1 --menu \"\" `expr $TMP1 + 7` 60 `echo $TMP1` `cat $TEMPM`" > $TEMPM2
    . $TEMPM2 2> $TEMPM
  fi
  rm -f $TEMPM $TEMPM2
}

# -------------
# create_xfconf
# -------------

create_xfconf() {

  if [ "$V_OCHIP" != "$V_CHIP" -o "$V_OMEM" != "$V_MEM" -o "$V_OMON" != "$V_MON" ]; then
    dialog --backtitle "$L_COPY" --txts $L_DIALOG \
           --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
           --btext "$CPUTYPE" -1 -1 --infobox "$L_WAIT" 3 25
    export V_OCHIP="$V_CHIP"
    export V_OMEM="$V_MEM"
    export V_OMON="$V_MON"
    MOUSEP=`echo "$MOUSE" | cut -f1 -d"_"`
    MOUSEN=`echo "$MOUSE" | cut -f2 -d"_"`
    MOUSEO=
    if [ "$MOUSEN" = "Microsoft" -o "$MOUSEN" = "PS/2" ]; then
      MOUSEO="Emulate3Buttons"
    fi
    MEM0=;MEM1=;MEM2=;MEM3=;MEM4=
    MFREE=`expr $V_MEM \* 1024`
    XMINN=$MFREE
    XMAX0N=0;XMAX1N=0;XMAX2N=0;XMAX3N=0;XMAX4N=0
    cat $MCONF/$V_MON | while read MLINE; do
      if [ "`echo $MLINE | cut -f1 -d\ `" = "Modeline" ]; then
        TMPX=`echo $MLINE | cut -f2 -d\" | cut -f1 -dx`
        TMPY=`echo $MLINE | cut -f2 -d\" | cut -f2 -dx`
        XYSIZE="`expr $TMPX \* $TMPY`"
        if [ 262144 -ge "`expr $XYSIZE / 2`" ]; then
          MEM0="$MEM0 `echo $MLINE | cut -f2 -d\ `"
          if [ "$XMAX0N" -lt "$XYSIZE" ]; then
            export XMAX0=$TMPX\x$TMPY
            XMAX0N=$XYSIZE
          fi
        fi
        if [ "$MFREE" -ge "$XYSIZE" ]; then
          MEM1="$MEM1 `echo $MLINE | cut -f2 -d\ `"
          if [ "$XMAX1N" -lt "$XYSIZE" ]; then
            export XMAX1=$TMPX\x$TMPY
            XMAX1N=$XYSIZE
          fi
          if [ "$MFREE" -ge "`expr $XYSIZE \* 2`" ]; then
            MEM2="$MEM2 `echo $MLINE | cut -f2 -d\ `"
            if [ "$XMAX2N" -lt "$XYSIZE" ]; then
              export XMAX2=$TMPX\x$TMPY
              XMAX2N=$XYSIZE
            fi
            if [ "$MFREE" -ge "`expr $XYSIZE \* 3`" ]; then
              MEM3="$MEM3 `echo $MLINE | cut -f2 -d\ `"
              if [ "$XMAX3N" -lt "$XYSIZE" ]; then
                export XMAX3=$TMPX\x$TMPY
                XMAX3N=$XYSIZE
              fi
              if [ "$MFREE" -ge "`expr $XYSIZE \* 4`" ]; then
                MEM4="$MEM4 `echo $MLINE | cut -f2 -d\ `"
                if [ "$XMAX4N" -lt "$XYSIZE" ]; then
                  export XMAX4=$TMPX\x$TMPY
                  XMAX4N=$XYSIZE
                fi
              fi
            fi
          fi
        fi
        if [ "$XMINN" -gt "$XYSIZE" ]; then
          export XMIN=$TMPX\x$TMPY
          XMINN="`expr $TMPX \* $TMPY`"
        fi
      fi
      if [ "$MLINE" = "EndSection" ]; then
        cat $VCONF/base > $XFC
        if [ -s "$VCONF/$V_CHIP/xconf" ]; then
          cat "$VCONF/$V_CHIP/xconf" >> $XFC
        fi
        echo -e "\nEndSection\nSection \"Pointer\"\n Protocol \"$MOUSEN\"\n Device \"/dev/$MOUSEP\"\n $MOUSEO\nEndSection\n" >> $XFC
        cat $MCONF/$V_MON >> $XFC

        echo -e "Section \"Screen\"\n Driver \"Mono\"\n Device \"Primary Card\"\n Monitor \"Primary Monitor\"" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 1\n  Modes $MEM4\n EndSubsection\nEndSection" >> $XFC

        echo -e "Section \"Screen\"\n Driver \"VGA16\"\n Device \"Primary Card\"\n Monitor \"Primary Monitor\"" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 4\n  Modes $MEM4\n EndSubsection\nEndSection" >> $XFC

        echo -e "Section \"Screen\"\n Driver \"SVGA\"\n Device \"Primary Card\"\n Monitor \"Primary Monitor\"" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 8\n  Modes $MEM1\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 15\n  Modes $MEM2\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 16\n  Modes $MEM2\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 24\n  Modes $MEM3\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 32\n  Modes $MEM4\n EndSubsection\nEndSection" >> $XFC

        echo -e "Section \"Screen\"\n Driver \"Accel\"\n Device \"Primary Card\"\n Monitor \"Primary Monitor\"" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 8\n  Modes $MEM1\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 15\n  Modes $MEM2\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 16\n  Modes $MEM2\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 24\n  Modes $MEM3\n EndSubsection" >> $XFC
        echo -e " SubSection \"Display\"\n  Depth 32\n  Modes $MEM4\n EndSubsection\nEndSection" >> $XFC
        echo "export XMIN=$XMIN;export XMAX0=$XMAX0;export XMAX1=$XMAX1;export XMAX2=$XMAX2;export XMAX3=$XMAX3;export XMAX4=$XMAX4" > /tmp/.limits
      fi
    done
    eval `cat /tmp/.limits`
    rm -f /tmp/.limits
  fi
}

# ----------
# boot_linux
# ----------

boot_linux() {

  TMP1=0
  for TMP2 in /tmp/.tty*; do
    TMP1=`expr $TMP1 + 1`
  done
  if [ "$TMP1" -gt 1 ]; then
    dialog --backtitle "$L_COPY" --title "$L_RESTXT" --txts $L_DIALOG \
           --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
           --btext "$CPUTYPE" -1 -1 --yesno "$L_RESASK" 5 60
  fi
  if [ "$?" = 0 -o "$TMP1" -lt 2 ]; then
    dialog --backtitle "$L_COPY" --txts $L_DIALOG \
           --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
           --btext "$CPUTYPE" -1 -1 --infobox "$L_RESET" 3 25
    reboot -f
  fi
}

# ---------
# main menu
# ---------

create_xfconf
LASTSEL=1

while [ 1 ]; do

  DEST=.
  TMPN=4
  echo -n > $TEMPM
  if [ -d /usr/X11R6/bin ]; then
    if [ -L "$VCONF/$V_CHIP/Xm" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "m \"X-Windows  1bit/ mono $L_COLORS ($L_GRPH $XMIN...$XMAX0)\" " >> $TEMPM
    fi
    if [ -L "$VCONF/$V_CHIP/X0" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "0 \"X-Windows  4bit/   16 $L_COLORS ($L_GRPH $XMIN...$XMAX0)\" " >> $TEMPM
    fi
    if [ -L "$VCONF/$V_CHIP/X1" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "1 \"X-Windows  8bit/  256 $L_COLORS ($L_GRPH $XMIN...$XMAX1)\" " >> $TEMPM
    elif [ "$LASTSEL" = 1 ]; then
      LASTSEL=_
    fi
    if [ -L "$VCONF/$V_CHIP/X2" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "2 \"X-Windows 16bit/65536 $L_COLORS ($L_GRPH $XMIN...$XMAX2)\" " >> $TEMPM
    fi
    if [ -L "$VCONF/$V_CHIP/X3" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "3 \"X-Windows 24bit/16mil $L_COLORS ($L_GRPH $XMIN...$XMAX3)\" " >> $TEMPM
    fi
    if [ -L "$VCONF/$V_CHIP/X4" ]; then
      TMPN=`expr $TMPN + 1`
      echo -n "4 \"X-Windows 32bit/16mil $L_COLORS ($L_GRPH $XMIN...$XMAX4)\" " >> $TEMPM
    fi
  fi
  echo -n "dialog --backtitle \"$L_COPY\" --title \"$L_SRVCS\" --txts $L_DIALOG --default \"$LASTSEL\" \
                  --btext \"$ETH_IP, $LANG, $DEFAULT, $MOUSE\" 2 -2 --btext \"$V_MON, $V_MEM, $V_CHIP, $TXSIZE\" 3 -2 \
                  --btext \"$CPUTYPE\" -1 -1 --menu \"\" `expr $TMPN + 7` 70 $TMPN " > $TEMPM2
  cat $TEMPM >> $TEMPM2
  echo -n "t \"Telnet (text)\" w \"$L_CFG\" p \"$L_PROC\" x \"$L_ENDX\" " >> $TEMPM2

  . $TEMPM2 2> $TEMPM
  rm -f $TEMPM2

  if [ -s $TEMPM ]; then
    CHOICE=`cat $TEMPM`
    LASTSEL=$CHOICE
    if [ $CHOICE != "w" -a $CHOICE != "f" -a $CHOICE != "x" -a $CHOICE != "p" ]; then
      dialog --backtitle "$L_COPY" --title "$L_LSERV" --txts $L_DIALOG \
             --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
             --btext "$CPUTYPE" -1 -1 --inputbox "($L_DFLT: $DEFAULT)" 9 40 2> $TEMPM2

      if [ "$?" != "0" ]; then
        CHOICE=_
      else
        CHOICE=`cat $TEMPM2`
        rm -f $TEMPM2

        if [ -z "$CHOICE" ]; then
          DEST=$DEFAULT
        else
          DEST=$CHOICE
        fi
      fi
    fi

    if [ "$CHOICE" != "_" ]; then
      CHOICE=`cat $TEMPM`
      if [ "$CHOICE" = "s" ]; then
        dialog --backtitle "$L_COPY" --title "$L_LNAME" --txts $L_DIALOG \
               --btext "$ETH_IP, $LANG, $DEFAULT, $MOUSE" 2 -2 --btext "$V_MON, $V_MEM, $V_CHIP, $TXSIZE" 3 -2 \
               --btext "$CPUTYPE" -1 -1 --inputbox "LOGIN?" 9 40 2> $TEMPM3
        if [ "$?" != "0" ]; then
          CHOICE=_
        else
          LOGIN_USER=`cat $TEMPM3`
        fi
      fi
    fi

    if [ "$DEST" != "_" ]; then
      case $CHOICE in
        m) export XFS="$VCONF/$V_CHIP/Xm"; runX "$DEST" 1;;
        0) export XFS="$VCONF/$V_CHIP/X0"; runX "$DEST" 4;;
        1) export XFS="$VCONF/$V_CHIP/X1"; runX "$DEST" 8;;
        2) export XFS="$VCONF/$V_CHIP/X2"; runX "$DEST" 16;;
        3) export XFS="$VCONF/$V_CHIP/X3"; runX "$DEST" 24;;
        4) export XFS="$VCONF/$V_CHIP/X4"; runX "$DEST" 32;;
        t) runtel "$DEST";;
        s) clear;ssh -l $SSH_USER $DEST;;
        w) clear;/etc/xcfg $TEMPM3;eval `cat $TEMPM3`;eval `cat /etc/lang/$LANG`;create_xfconf;;
        p) show_proc;;
        x) boot_linux;;
      esac
    fi
  fi
  rm -f $TEMPM

done