Fixed unwanted apparent output and sed command.

This commit is contained in:
Raphael Numbus
2025-11-23 21:28:00 +01:00
parent f6718237bb
commit 283051d6c8
+7 -7
View File
@@ -109,7 +109,7 @@ hardware_detection() {
TARGET_GRAPHICS="false" TARGET_GRAPHICS="false"
fi fi
echo -e "\n\n 🔎 Detecting transconding acceleration on target host..." echo -e "\n\n 🔎 Detecting transconding acceleration on target host..."
if ssh_to_host "ls /dev/dri/renderD128" 2>/dev/null; then if ssh_to_host "ls /dev/dri/renderD128 2>/dev/null"; then
echo -e " ✅ Transcoding capable card detected." echo -e " ✅ Transcoding capable card detected."
TARGET_GRAPHICS_RENDERER="true" TARGET_GRAPHICS_RENDERER="true"
else else
@@ -117,7 +117,7 @@ hardware_detection() {
TARGET_GRAPHICS_RENDERER="false" TARGET_GRAPHICS_RENDERER="false"
fi fi
echo -e "\n\n 🔎 Detecting USB Google Coral TPU on target host..." echo -e "\n\n 🔎 Detecting USB Google Coral TPU on target host..."
if ssh_to_host "lsusb | grep -iq 'google'" 2>/dev/null; then if ssh_to_host "lsusb | grep -iq 'google' 2>/dev/null"; then
echo -e " ✅ USB Google Coral TPU detected." echo -e " ✅ USB Google Coral TPU detected."
TARGET_USB_CORAL="true" TARGET_USB_CORAL="true"
else else
@@ -125,7 +125,7 @@ hardware_detection() {
TARGET_USB_CORAL="false" TARGET_USB_CORAL="false"
fi fi
echo -e "\n\n 🔎 Detecting Zigbee coordinator on target host..." echo -e "\n\n 🔎 Detecting Zigbee coordinator on target host..."
if ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee'" 2>/dev/null; then if ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee' 2>/dev/null"; then
echo -e " ✅ Zigbee device found in /dev/serial/by-id/." echo -e " ✅ Zigbee device found in /dev/serial/by-id/."
TARGET_ZIGBEE_DEVICE=$(ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee'") TARGET_ZIGBEE_DEVICE=$(ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee'")
TARGET_ZIGBEE="true" TARGET_ZIGBEE="true"
@@ -216,19 +216,19 @@ files_generation() {
}' docker/frigate.nix }' docker/frigate.nix
fi fi
if [[ "$TARGET_ZIGBEE" == "true" ]]; then if [[ "$TARGET_ZIGBEE" == "true" ]]; then
sed -i.bak ' sed -i.bak \
/^[[:space:]]*# ----------------------------------- #/{ '/^[[:space:]]*# ----------------------------------- #/{
N; N;
/DEVICES SECTION WILL APPEAR HERE IF/{ /DEVICES SECTION WILL APPEAR HERE IF/{
N; N;
/ZIGBEE USB DEVICE IS PRESENT/{ /ZIGBEE USB DEVICE IS PRESENT/{
N; N;
/----------------------------------- #/c\ /----------------------------------- #/c\'"
devices:\ devices:\
- /dev/serial/by-id/${TARGET_ZIGBEE_DEVICE}:/dev/ttyUSB0 - /dev/serial/by-id/${TARGET_ZIGBEE_DEVICE}:/dev/ttyUSB0
} }
} }
}' docker/hass.nix }" docker/hass.nix
fi fi
echo -e "\n\n ✅ Copying files to the new installation..." echo -e "\n\n ✅ Copying files to the new installation..."