Updates docs for SR1 with final revision
[genesis.git] / fuel / build / docker / ubuntu-builder / setcontext
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11 #
12 SETUSER=$1
13 SETUID=$2
14 SETGID=$3
15 SETHOME=$4
16
17 getent group $SETUSER || /usr/sbin/groupadd --gid $SETGID $SETUSER
18 getent passwd $SETUSER || /usr/sbin/adduser --system --uid=$SETUID --gid=$SETGID --home $SETHOME --shell /bin/bash $SETUSER
19 /usr/sbin/usermod -a -G fuse $SETUSER
20 exit 0