-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
43 lines (36 loc) · 783 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/bash
# This file set permissions for tests
# you must run this script after copy test colder
# for configuring permissions for files in test folders
INIT="./init.sh"
echo "##########################"
echo "Init scripts permissions"
echo "##########################"
passed=0
scripts=0
for i in $(ls)
do
if [[ -d $i ]]; then
cd $i
if [[ -e $INIT && -r $INIT && -x $INIT ]]; then
echo "------------------ INIT #$i"
error=$($INIT)
code=$?
res="FAIL"
if [[ $code == 0 ]]; then
res="PASSED"
((passed++))
else
echo "code='$code'"
echo "error='$error'"
fi
((scripts++))
echo "$res"
fi
cd ..
fi
done
echo "##########################"
echo "init passed: $passed/$scripts"
echo "End init"
echo "##########################"