mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-21 02:24:29 -04:00
Add modmanager hooks, fix indents
This commit is contained in:
+1
-1
@@ -15,6 +15,6 @@ trim_trailing_whitespace = false
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}]
|
[{docker-mods.*}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|||||||
+11
-2
@@ -353,9 +353,9 @@ run_mods() {
|
|||||||
MOD_OFFLINE="true"
|
MOD_OFFLINE="true"
|
||||||
else
|
else
|
||||||
# Determine first and only layer of image
|
# Determine first and only layer of image
|
||||||
SHALAYER=$(get_blob_sha "${TOKEN}" "${MANIFEST_URL}" "${TAG}" "${ARCH:=-amd64}")
|
SHALAYER=$(get_blob_sha "${TOKEN}" "${MANIFEST_URL}" "${TAG}" "${ARCH:--amd64}")
|
||||||
if [[ $? -eq 1 ]]; then
|
if [[ $? -eq 1 ]]; then
|
||||||
write_mod_error "No manifest available for arch ${ARCH:=-amd64}, cannot fetch mod"
|
write_mod_error "No manifest available for arch ${ARCH:--amd64}, cannot fetch mod"
|
||||||
continue
|
continue
|
||||||
elif [[ -z "${SHALAYER}" ]]; then
|
elif [[ -z "${SHALAYER}" ]]; then
|
||||||
write_mod_info "${DOCKER_MOD} digest could not be fetched from ${REGISTRY}, checking local cache"
|
write_mod_info "${DOCKER_MOD} digest could not be fetched from ${REGISTRY}, checking local cache"
|
||||||
@@ -410,6 +410,7 @@ run_mods() {
|
|||||||
fi
|
fi
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
if [[ -z "${MODMANAGER_MODONLY}" ]]; then
|
||||||
write_mod_info "Installing ${DOCKER_MOD}"
|
write_mod_info "Installing ${DOCKER_MOD}"
|
||||||
mkdir -p /tmp/mod
|
mkdir -p /tmp/mod
|
||||||
tar xzf "/modcache/${FILENAME}.tar.xz" -C /tmp/mod
|
tar xzf "/modcache/${FILENAME}.tar.xz" -C /tmp/mod
|
||||||
@@ -425,6 +426,9 @@ run_mods() {
|
|||||||
shopt -u dotglob
|
shopt -u dotglob
|
||||||
rm -rf /tmp/mod
|
rm -rf /tmp/mod
|
||||||
echo "${SHALAYER}" >"/${FILENAME}"
|
echo "${SHALAYER}" >"/${FILENAME}"
|
||||||
|
else
|
||||||
|
write_mod_debug "Modmanager skipping mod application"
|
||||||
|
fi
|
||||||
if [[ -f "/modcache/${FILENAME}.lock" ]]; then
|
if [[ -f "/modcache/${FILENAME}.lock" ]]; then
|
||||||
rm "/modcache/${FILENAME}.lock" || write_mod_error "Failed to delete lock file /modcache/${FILENAME}.lock"
|
rm "/modcache/${FILENAME}.lock" || write_mod_error "Failed to delete lock file /modcache/${FILENAME}.lock"
|
||||||
fi
|
fi
|
||||||
@@ -512,6 +516,11 @@ run_branding() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Main script loop
|
# Main script loop
|
||||||
|
if [[ -n "${MODMANAGER_MODONLY}" ]]; then
|
||||||
|
run_mods
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if grep -qEe ' / \w+ ro' /proc/mounts; then
|
if grep -qEe ' / \w+ ro' /proc/mounts; then
|
||||||
printf '1' > /run/s6/container_environment/LSIO_READ_ONLY_FS
|
printf '1' > /run/s6/container_environment/LSIO_READ_ONLY_FS
|
||||||
LSIO_READ_ONLY_FS=1
|
LSIO_READ_ONLY_FS=1
|
||||||
|
|||||||
Reference in New Issue
Block a user