generated from fearocanity/ebtrfio-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame_main.sh
25 lines (20 loc) · 769 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
#!/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}" || bash img_process.sh "failed" "${time_started}" || exit 1
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}"