-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
26 lines (24 loc) · 684 Bytes
/
init.sh
File metadata and controls
26 lines (24 loc) · 684 Bytes
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
#!/bin/bash
if [ -n "$EXTRA_PACKAGES" ] ; then
yum install -y $EXTRA_PACKAGES
fi
groupadd -g $USERGID engr
useradd -d $HOME -M -u $USERID -g $USERGID $USERNAME
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers > /dev/null
sudo usermod -a -G mock $USERNAME
echo "export MOCK_OPTS='--old-chroot'" >> /etc/bashrc
echo "export LANG='$LANG'" >> /etc/bashrc
echo
echo "Welcome to $RELEASE_DISTRO $RELEASE_VERSION builder"
echo
if [ -n "$SCRIPTRUNNER" ] ; then
if [ -d "$CURRENTPATH" ] ; then
cd $CURRENTPATH
else
cd $HOME
fi
chmod 755 $SCRIPTRUNNER
sudo --preserve-env="CURRENTPATH" -u $USERNAME $SCRIPTRUNNER
else
su - $USERNAME
fi