diff --git a/src/cleanup_container.sh b/src/cleanup_container.sh index daf6b06..5274338 100644 --- a/src/cleanup_container.sh +++ b/src/cleanup_container.sh @@ -8,7 +8,7 @@ cleanup() { # Add your cleanup commands here if [ -n "$PCI_1" ]; then - if [[ "$PCI_1" == 0000:* ]]; then + if [[ "$PCI_1" =~ ^[0-9]{4}: ]]; then PCI_SLOT="$PCI_1" else PCI_SLOT="0000:$PCI_1" diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index c433304..951d77b 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -252,7 +252,7 @@ USB_ARGS="${USB_1_ARGS} ${USB_2_ARGS}" PCI_ARGS="" PCI_1_ARGS="" if [[ -n "$PCI_1" ]]; then - if [[ "$PCI_1" == 0000:* ]]; then + if [[ "$PCI_1" =~ ^[0-9]{4}: ]]; then PCI_SLOT="$PCI_1" else PCI_SLOT="0000:$PCI_1"