Update share-common.func

This commit is contained in:
MacRimi
2025-08-26 17:19:11 +02:00
parent 4111e15eb9
commit aaba8569fc

View File

@@ -5,7 +5,7 @@
# ========================================================== # ==========================================================
# All console-visible strings MUST be wrapped with $(translate "..."). # All console-visible strings MUST be wrapped with $(translate "...").
# Comments and code are in English, as requested. # Comments and code are in English, as requested.
# Requires: utils.sh (show_proxmenux_logo, msg_info, msg_ok, msg_warn, msg_error, msg_title, etc.) #
# ========================================================== # ==========================================================
# Guard against multiple sourcing # Guard against multiple sourcing
@@ -406,7 +406,7 @@ pmx_add_bind_mount_to_ct() {
is_unprivileged=$(pmx_is_container_unprivileged "$ctid") is_unprivileged=$(pmx_is_container_unprivileged "$ctid")
if [[ "$is_unprivileged" == "true" ]]; then if [[ "$is_unprivileged" == "true" ]]; then
msg_info "$(translate "Configuring mount for unprivileged container...")"
# For unprivileged containers, append to config; requires restart # For unprivileged containers, append to config; requires restart
echo "${mpkey}: ${host_path},mp=${ct_path}" >> "$conf" echo "${mpkey}: ${host_path},mp=${ct_path}" >> "$conf"
msg_ok "$(translate "Bind mount appended to config (unprivileged).")" msg_ok "$(translate "Bind mount appended to config (unprivileged).")"
@@ -414,7 +414,7 @@ pmx_add_bind_mount_to_ct() {
msg_warn "$(translate "Restart the container to apply the mount.")" msg_warn "$(translate "Restart the container to apply the mount.")"
fi fi
else else
msg_info "$(translate "Configuring mount for privileged container...")"
# Privileged: try hot-apply via pct set; fallback to config # Privileged: try hot-apply via pct set; fallback to config
if [[ "$running" == "running" ]]; then if [[ "$running" == "running" ]]; then
if pct set "$ctid" -mp${mpidx} "${host_path},mp=${ct_path},create=dir" >/dev/null 2>&1; then if pct set "$ctid" -mp${mpidx} "${host_path},mp=${ct_path},create=dir" >/dev/null 2>&1; then
@@ -445,7 +445,7 @@ pmx_sync_group_in_ct() {
if [[ "$uid_shift" -eq 0 ]]; then if [[ "$uid_shift" -eq 0 ]]; then
# Privileged container - use same GID # Privileged container - use same GID
ct_gid="$host_gid" ct_gid="$host_gid"
msg_info "$(translate "Privileged container - using host GID:") $ct_gid" msg_ok "$(translate "Privileged container - using host GID:") $ct_gid"
else else
# Unprivileged container - map the GID # Unprivileged container - map the GID
ct_gid=$((host_gid - uid_shift)) ct_gid=$((host_gid - uid_shift))
@@ -454,7 +454,7 @@ pmx_sync_group_in_ct() {
ct_gid=1000 ct_gid=1000
msg_warn "$(translate "GID mapping resulted in negative value, using GID 1000 inside container")" msg_warn "$(translate "GID mapping resulted in negative value, using GID 1000 inside container")"
fi fi
msg_info "$(translate "Unprivileged container - mapped GID inside CT:") $ct_gid" msg_ok "$(translate "Unprivileged container - mapped GID inside CT:") $ct_gid"
fi fi
# Create or ensure group exists inside container # Create or ensure group exists inside container