summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.sh
blob: a227d8390e52991fb61fbd6ed6e97189bf238e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

rm -rv lava-master/devices/
rm -rv lava-master/slaves/
rm -rv lava-slave/conmux/
rm -rv lava-master/tokens/
rm -rv lava-master/users/
rm udev/*lavalab*rules

if [ "$1" = "mrproper" ];then
	exit 0
fi

./lavalab-gen.py || exit 1

#check for root
BEROOT=""
if [ $(id -u) -ne 0 ];then
	BEROOT="sudo "
fi
$BEROOT rm /etc/udev/rules.d/*lava*rules
$BEROOT cp udev/*lava*rules /etc/udev/rules.d/
$BEROOT udevadm control --reload-rules || exit $?
$BEROOT udevadm trigger || exit $?

docker-compose build || exit 1
docker-compose up -d || exit 1