diff options
Diffstat (limited to 'lava-slave')
-rw-r--r-- | lava-slave/Dockerfile | 1 | ||||
-rw-r--r-- | lava-slave/aliases/.empty | 0 | ||||
-rwxr-xr-x | lava-slave/scripts/setup.sh | 16 |
3 files changed, 17 insertions, 0 deletions
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile index 3877404..b93e310 100644 --- a/lava-slave/Dockerfile +++ b/lava-slave/Dockerfile @@ -61,6 +61,7 @@ RUN mkdir -p /root/.config COPY devices/ /root/devices/ COPY tags/ /root/tags/ +COPY aliases/ /root/aliases/ COPY deviceinfo/ /root/deviceinfo/ RUN if [ -x /usr/local/bin/extra_actions ] ; then /usr/local/bin/extra_actions ; fi diff --git a/lava-slave/aliases/.empty b/lava-slave/aliases/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lava-slave/aliases/.empty diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh index 1fb0bb3..4bf2f67 100755 --- a/lava-slave/scripts/setup.sh +++ b/lava-slave/scripts/setup.sh @@ -143,6 +143,22 @@ do done done +for devicetype in $(ls /root/aliases/) +do + lavacli $LAVACLIOPTS device-types aliases list $devicetype > /tmp/device-types-aliases-$devicetype.list + while read alias + do + grep -q " $alias$" /tmp/device-types-aliases-$devicetype.list + if [ $? -eq 0 ];then + echo "DEBUG: $alias for $devicetype already present" + continue + fi + echo "DEBUG: Add alias $alias to $devicetype" + lavacli $LAVACLIOPTS device-types aliases add $devicetype $alias || exit $? + echo " $alias" >> /tmp/device-types-aliases-$devicetype.list + done < /root/aliases/$devicetype +done + if [ -e /etc/lava-dispatcher/certificates.d/$(hostname).key ];then echo "INFO: Enabling encryption" sed -i 's,.*ENCRYPT=.*,ENCRYPT="--encrypt",' /etc/lava-dispatcher/lava-slave |