Good Morning,
I have script at /usr/local/bin/permissions.sh
with the following lines in it:
#!/bin/sh
echo
chown -R Docker:users /dev/dvb/adapter0
chown -R Docker:users /dev/dvb/adapter1
sleep 2
chmod -R 666 /dev/dvb/adapter0
chmod -R 666 /dev/dvb/adapter1
sleep 2
chown -R Docker:users /dev/dri/card0
chown -R Docker:users /dev/dri/renderD128
sleep 2
chmod -R 666 /dev/dri/card0
chmod -R 666 /dev/dri/renderD128
sleep 2
chown -R Docker:users /dev/ttyUSB0
sleep 2
chmod -R 666 /dev/ttyUSB0
echo
exit 0
I think it should be clear what it does. The tv card and the card reader need permissions for the user "Docker" because all docker are running not as root.
So far so good. The problem is, after every reboot I need to stop "Oscam" and "Tvheadend" Docker, execute this command and restart the dockers. Not that bad, because my machine is usually running 24/7, but sometimes i want to restart it und just need it automated.
How and where can I atomate this during startup before docker starts?
UDEV?
Crontab?
What do you guys recommend and how.
Thanks