mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
Fix mp mount detection pattern for pulse-sensor-proxy
The grep pattern was looking for 'pulse-sensor-proxy' as a standalone string, but the actual mount line contains paths like: mp0: /run/pulse-sensor-proxy,mp=/mnt/pulse-proxy,replicate=0 This caused the removal logic to never execute, leaving the old mp mount in place and preventing the migration to lxc.mount.entry format. Changed pattern to match either path component: - /pulse-sensor-proxy (source path) - /mnt/pulse-proxy (mount point) Also removed space after colon in pattern to match actual format. This completes the fix for temperature proxy setup on LXC containers.
This commit is contained in:
@@ -466,12 +466,12 @@ configure_proxy_socket_mount() {
|
||||
# Extract line number where snapshots start (first line starting with [)
|
||||
local snapshot_start=$(grep -n '^\[' "$temp_config" | head -1 | cut -d: -f1)
|
||||
|
||||
if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$temp_config" 2>/dev/null; then
|
||||
if grep -Eq '^mp[0-9]+:.*pulse-sensor-proxy|^mp[0-9]+:.*mnt/pulse-proxy' "$temp_config" 2>/dev/null; then
|
||||
print_info "Removing mp entries for pulse-sensor-proxy to keep snapshots and migrations working"
|
||||
if [ -n "$snapshot_start" ]; then
|
||||
sed -i "1,$((snapshot_start-1)) { /^mp[0-9]\+: .*pulse-sensor-proxy/d }" "$temp_config"
|
||||
sed -i "1,$((snapshot_start-1)) { /^mp[0-9]\+:.*pulse-sensor-proxy/d; /^mp[0-9]\+:.*mnt\/pulse-proxy/d }" "$temp_config"
|
||||
else
|
||||
sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$temp_config"
|
||||
sed -i '/^mp[0-9]\+:.*pulse-sensor-proxy/d; /^mp[0-9]\+:.*mnt\/pulse-proxy/d' "$temp_config"
|
||||
fi
|
||||
updated=true
|
||||
fi
|
||||
|
||||
@@ -3166,13 +3166,13 @@ if [[ "$STANDALONE" == false ]]; then
|
||||
# Extract line number where snapshots start (first line starting with [)
|
||||
SNAPSHOT_START=$(grep -n '^\[' "$TEMP_CONFIG" | head -1 | cut -d: -f1)
|
||||
|
||||
if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$TEMP_CONFIG" 2>/dev/null; then
|
||||
if grep -Eq '^mp[0-9]+:.*pulse-sensor-proxy|^mp[0-9]+:.*mnt/pulse-proxy' "$TEMP_CONFIG" 2>/dev/null; then
|
||||
print_info "Removing mp mounts for pulse-sensor-proxy to keep snapshots and migrations working"
|
||||
if [ -n "$SNAPSHOT_START" ]; then
|
||||
# Only modify main section (before snapshots)
|
||||
sed -i "1,$((SNAPSHOT_START-1)) { /^mp[0-9]\+: .*pulse-sensor-proxy/d }" "$TEMP_CONFIG"
|
||||
sed -i "1,$((SNAPSHOT_START-1)) { /^mp[0-9]\+:.*pulse-sensor-proxy/d; /^mp[0-9]\+:.*mnt\/pulse-proxy/d }" "$TEMP_CONFIG"
|
||||
else
|
||||
sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$TEMP_CONFIG"
|
||||
sed -i '/^mp[0-9]\+:.*pulse-sensor-proxy/d; /^mp[0-9]\+:.*mnt\/pulse-proxy/d' "$TEMP_CONFIG"
|
||||
fi
|
||||
MOUNT_UPDATED=true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user