-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathframe_main.sh
28 lines (23 loc) · 867 Bytes
/
frame_main.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
#!/bin/bash
# Import config.conf
. config.conf
. scripts/post.sh
[[ -e status/status.jpg ]] && : > status/status.jpg
prev_frame="$(<"${FRMENV_ITER_FILE}")"
time_started="$(TZ="${FRMENV_SYS_TIMEZONE}" date)"
# Main Loop
for ((i=1;i<=fph;i++)); do
bash ./main.sh "${1}" "${2}"
error_code="$?"
[[ "${error_code}" == 1 ]] && { bash img_process.sh "failed" "${time_started}" || exit 1 ;}
[[ "${error_code}" == 12 ]] && exit 0
sleep "$((mins * 60))"
done
lim_frame="$((prev_frame+fph-1))"
[[ "${lim_frame}" -gt "${total_frame}" ]] && lim_frame="${total_frame}"
[[ "${prev_frame}" -gt "${total_frame}" ]] && prev_frame="${total_frame}"
time_ended="$(TZ="${FRMENV_SYS_TIMEZONE}" date)"
if [[ "${desc_update}" == "1" ]]; then
post_changedesc "${1}"
fi
bash img_process.sh "success" "${prev_frame}" "${lim_frame}" "${time_started}" "${time_ended}"