summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lavalab-gen.sh')
-rwxr-xr-xlavalab-gen.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/lavalab-gen.sh b/lavalab-gen.sh
index 06df881..31b45f8 100755
--- a/lavalab-gen.sh
+++ b/lavalab-gen.sh
@@ -13,8 +13,15 @@ fi
./lavalab-gen.py || exit 1
-rm /etc/udev/rules.d/lavalab*rules
-cp lavalab*rules /etc/udev/rules.d/
+#check for root
+BEROOT=""
+if [ $(id -u) -ne 0 ];then
+ BEROOT="sudo "
+fi
+$BEROOT rm /etc/udev/rules.d/*lavalab*rules
+$BEROOT cp *lavalab*rules /etc/udev/rules.d/
+$BEROOT udevadm control --reload-rules || exit $?
+$BEROOT udevadm trigger || exit $?
docker-compose build || exit 1
docker-compose up || exit 1