Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Commit f0548e1

Browse files
committed
Fix run regex
1 parent 43117b0 commit f0548e1

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

root/etc/s6-overlay/s6-rc.d/init-pmm-oneshot/run

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ if [[ -n "${CONFIG_FILE}" ]] && [[ ! -e "${CONFIG_FILE}" ]]; then
1616
s6-rc -bad change
1717
fi
1818

19-
if { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--run|-r)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; } && { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; }; then
19+
if { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--run|-r)([^\S]|$)'; } && { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; }; then
2020
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py ${CLI_OPTIONS}
21-
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--run|-r)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; then
22-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" ${CLI_OPTIONS:+"$CLI_OPTIONS"}
21+
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--run|-r)([^\S]|$)'; then
22+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" ${CLI_OPTIONS}
2323
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; then
2424
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --run ${CLI_OPTIONS}
2525
else
26-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --run --config "${CONFIG_FILE}" ${CLI_OPTIONS:+"$CLI_OPTIONS"}
26+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --run --config "${CONFIG_FILE}" ${CLI_OPTIONS}
2727
fi

root/etc/s6-overlay/s6-rc.d/svc-pmm/run

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ if [[ -n "${CONFIG_FILE}" ]] && [[ ! -e "${CONFIG_FILE}" ]]; then
1616
s6-rc -bad change
1717
fi
1818

19-
if { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--time|-t)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; } && { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; }; then
19+
if { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--time|-t)([^\S])'; } && { echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; }; then
2020
exec \
21-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py ${CLI_OPTIONS:+"$CLI_OPTIONS"}
22-
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--time|-t)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; then
21+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py ${CLI_OPTIONS}
22+
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--time|-t)([^\S])'; then
2323
exec \
24-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" ${CLI_OPTIONS:+"$CLI_OPTIONS"}
24+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" ${CLI_OPTIONS}
2525
elif echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--config|-c)([^\S])(.+\/[^\/]+)\.(yml|yaml)'; then
2626
exec \
27-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --time "${PMM_TIME:-03:00}" ${CLI_OPTIONS:+"$CLI_OPTIONS"}
27+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --time "${PMM_TIME:-03:00}" ${CLI_OPTIONS}
2828
else
2929
exec \
30-
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" --time "${PMM_TIME:-03:00}" ${CLI_OPTIONS:+"$CLI_OPTIONS"}
30+
s6-setuidgid abc python3 /app/pmm/plex_meta_manager.py --config "${CONFIG_FILE}" --time "${PMM_TIME:-03:00}" ${CLI_OPTIONS}
3131
fi

root/init-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
if [[ $(tr "[:upper:]" "[:lower:]" <<<"${PMM_RUN}") = "true" ]] || [[ ${CLI_OPTIONS} = *"-r"* ]] || [[ ${CLI_OPTIONS} = *"--run"* ]]; then
3+
if [[ $(tr "[:upper:]" "[:lower:]" <<<"${PMM_RUN}") = "true" ]] || echo "${CLI_OPTIONS}" | grep -qPo '[\s]?(--run|-r)([^\S]|$)'; then
44
rm -rf /etc/s6-overlay/s6-rc.d/svc-pmm
55
rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/svc-pmm
66
rm -rf /etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-pmm-config

0 commit comments

Comments
 (0)