#!/bin/bash
# scan through all the plugins to pick up function definitions

PLUGINDIR=/usr/share/xs-config/plugins.d
export PLUGINDIR
LOG=/var/log/xs-setup.log
#HTTPDVER=`rpm -qi httpd|gawk '/Version/{print $3}'`
#export HTTPDVER

XSARCH=`uname -i`
echo $XSARCH
export XSARCH

if [ -e /proc/device-tree/mfg-data/MN ]; then
  XOTYPE=`cat /proc/device-tree/mfg-data/MN`
else
  XOTYPE=""
fi

echo $XOTYPE
export XOTYPE

#XO=`cat /proc/device-tree/mfg-data/MN` 
#if [ -z $XO ]; then
#    XOTYPE=$XO
#else
#    XOTYPE=""
#fi
#export XOTYPE

#MARKER=/.olpcxs-configured

for mod in `ls $PLUGINDIR`; do
    if [ -d $PLUGINDIR/$mod ];then
        pushd $PLUGINDIR/$mod > /dev/null
        SCRIPTLIST=`ls -1 *.sh`
        for script in $SCRIPTLIST;do
            if [ ! -z $script ]; then
                source "./$script"
            fi
        done
        popd > /dev/null
    fi
done
