34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
echo -e "\n##################################"
|
|
# which groupadd
|
|
# which useradd
|
|
# which /bin/bash
|
|
# echo SHELL $SHELL
|
|
|
|
groupadd -g 1000 host
|
|
useradd -r -g host -u 1000 host
|
|
groupadd -g 1001 sysadmin
|
|
useradd -rm -s /bin/bash -G host,$([[ $(getent group sudo) ]] && echo sudo || echo wheel) -g sysadmin -u 1001 sysadmin
|
|
echo sysadmin groups: $(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
|
|
export SHELL=/bin/bash
|
|
mkdir -p /home/sysadmin/shell
|
|
/bin/bash /shell/base/install/install.sh sysadmin
|
|
echo "******** uci shell install complete **********"
|
|
/bin/bash -l -c "module_load dir; dir_copy scripts /opt"
|
|
echo installed scripts in /opt/scripts
|
|
ls -la /opt/scripts
|
|
source /opt/scripts/container.env
|
|
# make essential directories
|
|
mkdir -p $SHARED_DIRS /opt/scripts /opt/bin
|
|
chown -R host:host /home/sysadmin/shell $SHARED_DIRS /opt/scripts /opt/bin
|
|
chmod -R g+rw /home/sysadmin/shell $SHARED_DIRS /opt/scripts /opt/bin
|
|
echo installing and running image distro info
|
|
/bin/bash install-info.sh
|
|
/opt/scripts/info
|