34 lines
556 B
Bash
Executable File
34 lines
556 B
Bash
Executable File
#!/bin/bash
|
|
|
|
safe_exec() {
|
|
echo "safe_exec: ${*}"
|
|
local tries=5
|
|
|
|
for ((i=0; i < ${tries}; i++)); do
|
|
"${@}" && return 0
|
|
|
|
if [ "${i}" = "0" ]; then
|
|
sleep 10
|
|
continue
|
|
else
|
|
sleep 60
|
|
continue
|
|
fi
|
|
done
|
|
return 1
|
|
}
|
|
|
|
cd "${PARTICLES_DIR}" || exit 1
|
|
safe_exec git pull || exit 1
|
|
cd "${BUILD_GIT_DIR}" || exit 1
|
|
safe_exec git pull || exit 1
|
|
|
|
particles=$(find "${PARTICLES_DIR}" -name "*.particle" | sort)
|
|
if [ -n "${particles}" ]; then
|
|
/usr/sbin/env-update
|
|
. /etc/profile
|
|
matter ${MATTER_ARGS} ${particles}
|
|
exit ${?}
|
|
fi
|
|
exit 1
|