diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2018-01-08 14:30:24 +0100 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2018-01-08 15:15:50 +0100 |
commit | 633d0339534944b22c95e58dd069b76fb9dfcd44 (patch) | |
tree | b5bf097bc8123a09a1ce0c736ddd144bf065a554 | |
parent | 34c6269457b8075f2951c37ca2a1901bd71379ea (diff) |
Some actions need root privileges
Some actions must be done by root, add a detection for that.
-rwxr-xr-x | lavalab-gen.sh | 11 |
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 |