forked from jchaney/owncloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extensions.sh
executable file
·49 lines (37 loc) · 945 Bytes
/
extensions.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
44
45
46
47
48
#!/usr/bin/env bash
EXTCONF="${1}"
EXTAPPDIR="${2}"
if [ ! -d "${EXTAPPDIR}" ]; then
echo "app dir not located ad ${EXTAPPDIR}. Exit processing of extensions.sh"
exit 1
fi
pushd "${EXTAPPDIR}"
if [ ! -e "${EXTCONF}" ]; then
echo "extconf doesn exists at ${EXTCONF}. Exit processing of extensions.sh"
exit 1
fi
while read line
do
# filter empty and commented lines
[ "${line}" == "" ] && continue
[ "${line:0:1}" == "#" ] && continue
# parsing
IFS="!" read -ra entry <<< "${line}"
NAME="${entry[0]}"
CMDL="${entry[1]}"
echo ""
echo "-=> work on ... ${NAME} "
# yea - its secure nightmare here, but we call this only in a docker
# container at buildtime
if [ ! -z "${CMDL}" ]; then
while IFS=";" read -ra cmdarr; do
for cmd in "${cmdarr[@]}"; do
[ -z "${cmd}" ] && continue
echo "::: execute \"${cmd}\""
${cmd}
done
done <<< $(echo "${CMDL}")
fi
echo "<=- ${NAME} done"
done < "${EXTCONF}"
popd