Skip to content

Instantly share code, notes, and snippets.

@HiFiPhile
Last active January 15, 2022 17:11
Show Gist options
  • Save HiFiPhile/9dbe6ba7eab8dbb14768efb8238a5909 to your computer and use it in GitHub Desktop.
Save HiFiPhile/9dbe6ba7eab8dbb14768efb8238a5909 to your computer and use it in GitHub Desktop.
Simple script to add devices to lxc
#!/usr/bin/env bash
CT_LIST=(
108
)
DEV_108=(
/dev/ttyUSB0
enx2c01ed583fc8
)
PATH=/bin:/sbin:/usr/bin/:/usr/sbin
while true
do
for ct in ${CT_LIST[@]}
do
devs=DEV_${ct}[@]
for dev in ${!devs}
do
lxc-device ${ct} add ${dev} -q
done
done
sleep 3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment