#!/bin/sh
wall "Menu Fantastic startup.sh executed"
PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/Fantastic
CMDS=startup.cmd
COMMANDS=""
LENGTH=0
if [ -f $PLUGINDIR/$CMDS ]; then
   LENGTH=`cat $PLUGINDIR/$CMDS | wc -l`
fi
ZEILE=1
while [ $ZEILE -le $LENGTH ]
do
    CMD=`head -n $ZEILE $PLUGINDIR/$CMDS | tail -n 1`
    CMDUNCOMMENTED=""
    CMDBUFFER=""
    for CMDRUNNING in $CMD; do
        if [ $CMDRUNNING = "#" ]; then
           CMDUNCOMMENTED=$CMDBUFFER
        else
           CMDBUFFER="$CMDBUFFER $CMDRUNNING"
        fi
    done
    echo executing Line $ZEILE: command: $CMDUNCOMMENTED
    $CMDUNCOMMENTED
    ZEILE=`expr $ZEILE "+" 1`
done
exit 0
