summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.sh
blob: 60c5d947d0e64b09279ae279916daf96425211e8 (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
28
29
30
#!/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
rm lava-master/scripts/build-lava
rm lava-slave/scripts/build-lava
rm docker-compose.yml

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