Added programs to list and removed unnecessary variables.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p gum openssl sops ssh-to-age age sshpass envsubst
|
#!nix-shell -i bash -p gum openssl sops ssh-to-age age sshpass envsubst pciutils usbutils
|
||||||
|
|
||||||
prerun_action() {
|
prerun_action() {
|
||||||
echo -e "$1"
|
echo -e "$1"
|
||||||
@@ -128,10 +128,8 @@ hardware_detection() {
|
|||||||
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"
|
|
||||||
else
|
else
|
||||||
echo -e " ℹ️ No Zigbee device found."
|
echo -e " ℹ️ No Zigbee device found."
|
||||||
TARGET_ZIGBEE="false"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +184,7 @@ files_generation() {
|
|||||||
sed -i.bak "/# --- frigate devices --- #/d" docker/frigate.nix
|
sed -i.bak "/# --- frigate devices --- #/d" docker/frigate.nix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TARGET_ZIGBEE" == "true" ]]; then
|
if [[ -n "$TARGET_ZIGBEE_DEVICE" ]]; then
|
||||||
REPLACEMENT="devices:\n - /dev/serial/by-id/${TARGET_ZIGBEE_DEVICE}:/dev/ttyUSB0"
|
REPLACEMENT="devices:\n - /dev/serial/by-id/${TARGET_ZIGBEE_DEVICE}:/dev/ttyUSB0"
|
||||||
sed -i.bak "s|# --- hass devices --- #|$REPLACEMENT|" docker/hass.nix
|
sed -i.bak "s|# --- hass devices --- #|$REPLACEMENT|" docker/hass.nix
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user