Skip to content

Commit b055e46

Browse files
committed
docker: healthcheck: delay directory writability check
1 parent 9fae224 commit b055e46

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ COPY --chmod=755 <<-'EOF' /usr/bin/ctbcap-healthcheck
7272
;;
7373
esac
7474

75-
# Is directories writable?
76-
[ ! -w "${SAVE_PATH}" ] && { echo "(ERROR) SAVE_PATH is unwritable!"; exit 1; }
77-
[ "${LOG_PATH}" = 0 ] || {
78-
[ ! -w "${LOG_PATH}" ] && { echo "(ERROR) LOG_PATH is unwritable!"; exit 1; }
79-
}
80-
8175
FFMPEG_PROCESS="$(ps -ef | grep -oE "[f]fmpeg.*-i.*.m3u8.*${MODEL}.*.mkv" 2>/dev/null | head -n 1)"
8276
# If has FFmpeg process...
8377
[ -n "${FFMPEG_PROCESS}" ] && {
78+
79+
# Is directories writable?
80+
[ ! -w "${SAVE_PATH}" ] && { echo "(ERROR) [${SAVE_PATH}] is unwritable!"; exit 1; }
81+
[ "${LOG_PATH}" = 0 ] || {
82+
[ ! -w "${LOG_PATH}" ] && { echo "(ERROR) [${LOG_PATH}] is unwritable!"; exit 1; }
83+
}
84+
8485
STREAM_URL="$(echo "${FFMPEG_PROCESS}" | grep -oE 'http[s]?://[^ ]+\.m3u8')"
8586
UA="$(ctbcap -v | grep '^UA: ' | sed 's|UA: ||')"
8687
[ -z "${UA}" ] && { echo "(ERROR) UA does not exist!"; exit 1; }

0 commit comments

Comments
 (0)