#!/bin/bash ARCH=`uname -m` echo ${ARCH} | grep "arm" > /dev/null if [ $? != 0 ] ; then echo "+---------------------------------------------------+" echo "| ERROR: This folder must compile on RaspberryPi |"; echo "+---------------------------------------------------+" exit 1; fi function do_compile { for dir in `ls` do if [ -f $dir/build*.sh ] ; then cd $dir ./build*.sh cd - fi done } function do_clean { for dir in `ls` do if [ -f $dir/build*.sh ] ; then rm -rf ${dir}/${dir}* fi done } if [[ $# == 1 ]] && [[ $1 == "clean" ]] ; then do_clean exit; fi do_compile