#!/bin/bash if [ "$#" -ne 1 ]; then echo "./deploy " exit fi getBins() { utilBinList="$(find $1 -executable -type f)" for bin in $utilBinList; do cp $bin $2; done } &>/dev/null setup() { if [ -d $1 ]; then rm -rf $1 else mkdir $1 fi mkdir ./$1/util mkdir ./$1/test mkdir ./$1/lib } &>/dev/null upload() { scp -r $1/* pi@$2:/home/pi/Desktop } setup build getBins ./util ./build/util getBins ./test ./build/test getBins ./lib ./build/lib echo "Deploying dvb-apps to the target device. [$1]" upload build $1