Fixed unwanted apparent output and sed command.

This commit is contained in:
Raphael Numbus
2025-11-23 21:22:25 +01:00
parent c8634c8351
commit f6718237bb
+8 -8
View File
@@ -95,13 +95,13 @@ ssh_to_host() {
hardware_detection() { hardware_detection() {
echo -e "\n\n 🔎 Detecting graphics card on target host..." echo -e "\n\n 🔎 Detecting graphics card on target host..."
VGA_INFO=$(ssh_to_host "lspci -nn | grep -i 'vga'") VGA_INFO=$(ssh_to_host "lspci -nn | grep -i 'vga'")
if echo "$VGA_INFO" | grep -iq "intel"; then if echo "$VGA_INFO" | grep -iq "intel" 2>/dev/null; then
echo -e " ✅ Intel graphics card detected." echo -e " ✅ Intel graphics card detected."
TARGET_GRAPHICS="true" TARGET_GRAPHICS="true"
elif echo "$VGA_INFO" | grep -iq "amd"; then elif echo "$VGA_INFO" | grep -iq "amd" 2>/dev/null; then
echo -e " ✅ AMD graphics card detected." echo -e " ✅ AMD graphics card detected."
TARGET_GRAPHICS="true" TARGET_GRAPHICS="true"
elif echo "$VGA_INFO" | grep -iq "nvidia"; then elif echo "$VGA_INFO" | grep -iq "nvidia" 2>/dev/null; then
echo -e " ✅ NVIDIA graphics card detected." echo -e " ✅ NVIDIA graphics card detected."
TARGET_GRAPHICS="true" TARGET_GRAPHICS="true"
else else
@@ -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"; 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'"; 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'"; 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,7 +216,7 @@ 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/{
@@ -228,7 +228,7 @@ files_generation() {
- /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..."