summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-01-11 21:32:19 +0100
committerHolger Levsen <holger@layer-acht.org>2016-01-11 21:32:19 +0100
commit100a143e50601f64254c29abbf3671aeef519bdf (patch)
tree08aa0d256ff0c2dd0d5dbb4a3bbbfb94c8f3d5a9
parent56ee74bde84b89834b6be8ed03d590d8367ff01b (diff)
downloadjenkins.debian.net-100a143e50601f64254c29abbf3671aeef519bdf.tar.xz
put all users in correct groups
-rwxr-xr-xupdate_jdn.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index 4e42aa3c..116f8b15 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -64,6 +64,7 @@ for user in helmut holger mattia lunar philh ; do
# philh only wants to test stuff
continue
fi
+ # actually create the user
if ! getent passwd $user > /dev/null ; then
if [ "$user" = "mattia" ] ; then
usershell=/bin/zsh
@@ -71,12 +72,16 @@ for user in helmut holger mattia lunar philh ; do
usershell=/bin/bash
fi
sudo adduser --gecos "" --shell "$usershell" --disabled-password $user
- if [ "$user" = "holger" ] ; then
- sudo usermod -G jenkins,jenkins-adm,sudo,adm $user
- elif [ "$user" != "lunar" ] ; then
- sudo usermod -G jenkins,jenkins-adm $user
- fi
fi
+ # put user in groups
+ if [ "$HOSTNAME" = "jenkins" ] && [ "$user" = "lunar" ] ; then
+ extra_groups="reproducible"
+ elif [ "$HOSTNAME" = "jenkins" ] ; then
+ extra_groups="reproducible,jenkins,jenkins-adm,sudo,adm"
+ else
+ extra_groups="jenkins,jenkins-adm,sudo,adm"
+ fi
+ sudo usermod -G $extra_groups $user
done
sudo mkdir -p /srv/workspace