diff options
author | khilman <khilman@users.noreply.github.com> | 2019-01-15 16:01:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 16:01:38 -0800 |
commit | a0b84c74351f55f252b4de81dc2dc0a89e1163b8 (patch) | |
tree | a9fedfc507ace864a1c4e1c8ca99b1471df37f2c /lava-master | |
parent | aa67c3f5cd3fc6e006943917935318dccbedea30 (diff) | |
parent | e9c7827af4a9f8e52b8f0df04365808298d08c0a (diff) |
Merge pull request #83 from montjoie/misc
Misc
Diffstat (limited to 'lava-master')
-rw-r--r-- | lava-master/Dockerfile | 2 | ||||
-rw-r--r-- | lava-master/default/.empty | 0 | ||||
-rwxr-xr-x | lava-master/scripts/setup.sh | 16 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile index b41446f..5d2a119 100644 --- a/lava-master/Dockerfile +++ b/lava-master/Dockerfile @@ -4,6 +4,8 @@ COPY backup /root/backup/ COPY configs/tftpd-hpa /etc/default/tftpd-hpa +COPY default/* /etc/default/ + RUN git clone https://github.com/BayLibre/lava-healthchecks.git RUN cp lava-healthchecks/health-checks/* /etc/lava-server/dispatcher-config/health-checks/ COPY health-checks/* /etc/lava-server/dispatcher-config/health-checks/ diff --git a/lava-master/default/.empty b/lava-master/default/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lava-master/default/.empty diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh index 6153c9d..c22a06f 100755 --- a/lava-master/scripts/setup.sh +++ b/lava-master/scripts/setup.sh @@ -55,12 +55,24 @@ if [ -e /root/lava-users ];then if [ $SUPERUSER -eq 1 ];then USER_OPTION="$USER_OPTION --superuser" fi - lava-server manage users list | grep -q "[[:space:]]$USER$" + lava-server manage users list --all > /tmp/allusers + if [ $? -ne 0 ];then + echo "ERROR: cannot generate user list" + exit 1 + fi + #filter first name/last name (enclose by "()") + sed -i 's,[[:space:]](.*$,,' /tmp/allusers + grep -q "[[:space:]]${USER}$" /tmp/allusers if [ $? -eq 0 ];then echo "Skip already existing $USER DEBUG(with $TOKEN / $PASSWORD / $USER_OPTION)" else echo "Adding username $USER DEBUG(with $TOKEN / $PASSWORD / $USER_OPTION)" - lava-server manage users add --passwd $PASSWORD $USER_OPTION $USER || exit 1 + lava-server manage users add --passwd $PASSWORD $USER_OPTION $USER + if [ $? -ne 0 ];then + echo "ERROR: Adding user $USER" + cat /tmp/allusers + exit 1 + fi if [ ! -z "$TOKEN" ];then echo "Adding token to user $USER" lava-server manage tokens add --user $USER --secret $TOKEN || exit 1 |