27 lines
894 B
Bash
27 lines
894 B
Bash
#!/bin/bash
|
|
|
|
echo -e "\n##################################"
|
|
# add admin user
|
|
groupadd -g 1000 host
|
|
useradd -r -g host -u 1000 host
|
|
groupadd -g 1001 sysadmin
|
|
useradd -rm -s /bin/bash -G sudo,host -g sysadmin -u 1001 sysadmin
|
|
groups sysadmin
|
|
chpasswd <<<"sysadmin:${SYSADMIN_PW:-sysadmin}"
|
|
cp permitmod /etc/sudoers.d
|
|
chmod 440 /etc/sudoers.d/permitmod
|
|
|
|
git clone https://git.kebler.net/bash/shell-base.git /shell/base
|
|
/bin/bash /shell/base/install/install.sh sysadmin
|
|
# copy permenent scripts to /opt/scripts
|
|
/bin/bash -l -c "module_load dir; dir_copy scripts /opt"
|
|
source /opt/scripts/container.env
|
|
# make essential directories
|
|
mkdir -p $SHARED_DIRS /opt/scripts /opt/bin
|
|
# let the sysadmin user (1000) own these and group write
|
|
# install distro info screen
|
|
/bin/bash install-info.sh
|
|
chown -R sysadmin:sysadmin $SHARED_DIRS
|
|
chmod -R g+rw $SHARED_DIRS
|
|
# call distro info
|
|
/bin/bash -l -c "info" |