fix: configure PULSE_SENSOR_PROXY_SOCKET env var during LXC install
When installing Pulse in an LXC container with temperature proxy support, the installation now automatically: - Configures PULSE_SENSOR_PROXY_SOCKET in /etc/pulse/.env - Restarts Pulse service to pick up the configuration This ensures temperature monitoring works immediately without requiring manual configuration after installation.
This commit is contained in:
parent
29bb2460e4
commit
dfc0085048
1 changed files with 20 additions and 0 deletions
20
install.sh
20
install.sh
|
|
@ -1232,6 +1232,26 @@ create_lxc_container() {
|
||||||
# Get container IP
|
# Get container IP
|
||||||
local IP=$(pct exec $CTID -- hostname -I | awk '{print $1}')
|
local IP=$(pct exec $CTID -- hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
|
if [[ "$IN_CONTAINER" != "true" ]] && [[ "$PROXY_PREPARE_MOUNT" == "true" ]]; then
|
||||||
|
print_info "Configuring pulse-sensor-proxy socket inside container..."
|
||||||
|
if ! pct exec $CTID -- bash -c 'set -e
|
||||||
|
ENV_FILE="/etc/pulse/.env"
|
||||||
|
SOCKET_LINE="PULSE_SENSOR_PROXY_SOCKET=/mnt/pulse-proxy/pulse-sensor-proxy.sock"
|
||||||
|
mkdir -p /etc/pulse
|
||||||
|
if [[ -f "$ENV_FILE" ]] && grep -q "^PULSE_SENSOR_PROXY_SOCKET=" "$ENV_FILE" 2>/dev/null; then
|
||||||
|
sed -i "s|^PULSE_SENSOR_PROXY_SOCKET=.*|$SOCKET_LINE|" "$ENV_FILE"
|
||||||
|
else
|
||||||
|
echo "$SOCKET_LINE" >> "$ENV_FILE"
|
||||||
|
fi'; then
|
||||||
|
print_error "Failed to configure pulse-sensor-proxy socket inside container"
|
||||||
|
cleanup_on_error
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! pct exec $CTID -- systemctl restart $SERVICE_NAME >/dev/null 2>&1; then
|
||||||
|
print_warn "Unable to restart $SERVICE_NAME inside container; please restart manually"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine if we should install temperature proxy
|
# Determine if we should install temperature proxy
|
||||||
local install_proxy=false
|
local install_proxy=false
|
||||||
local docker_in_container=false
|
local docker_in_container=false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue