summaryrefslogtreecommitdiff
path: root/scripts/common-hal-directory-check.post
blob: 3366867d7fb3faca2de398bb3baae210c1987d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

echo "#################### common-hal-directory-check.post ####################"
if [ -d /hal ]; then
	VALUE=`/usr/bin/ls -R /hal | /usr/bin/grep -v "hal\:"`
	if [ "$VALUE" ]; then
		echo "WARNING!! There are some files to install to wrong path (/hal)"
		echo "WARNING!! It has to be nothing under hal directory."
		FILES=`/usr/bin/ls -R /hal`
		for file in $FILES; do
			if [[ $file =~ ":" ]]; then
				echo $file
				DIR=`echo $file | /usr/bin/awk -F ":" '{print $1}'`
			fi
			if [ -f $DIR/$file ]; then
				echo $file
			fi
		done
	fi
fi