summaryrefslogtreecommitdiffstats
path: root/lcpubsh/image_template
diff options
context:
space:
mode:
authorGeorg2021-08-14 20:38:16 +0200
committerGeorg2021-08-14 20:38:16 +0200
commit39e54cc83b2d4d78191ada3dceafa22208336641 (patch)
tree5223463e800b43ff22b4b6c444c49cc2759724ea /lcpubsh/image_template
parentc27753da863b3c44ceb81b2fe6ac689550704f89 (diff)
downloadpublic-shell-39e54cc83b2d4d78191ada3dceafa22208336641.tar.gz
public-shell-39e54cc83b2d4d78191ada3dceafa22208336641.tar.bz2
public-shell-39e54cc83b2d4d78191ada3dceafa22208336641.zip
Improvements 14/08/2021HEADmaster
Signed-off-by: Georg <georg@lysergic.dev>
Diffstat (limited to 'lcpubsh/image_template')
-rw-r--r--lcpubsh/image_template/user-mapping.sh21
l---------lcpubsh/image_template/user_mapping.sh1
2 files changed, 1 insertions, 21 deletions
diff --git a/lcpubsh/image_template/user-mapping.sh b/lcpubsh/image_template/user-mapping.sh
deleted file mode 100644
index f2aa456..0000000
--- a/lcpubsh/image_template/user-mapping.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Original by https://github.com/sleeepyjack/dockersh
-# Modified by georg@lysergic.dev
-if [ -z "${HOST_USER_NAME}" -o -z "${HOST_USER_ID}" -o -z "${HOST_USER_GID}" ]; then
- echo "HOST_USER_NAME, HOST_USER_ID & HOST_USER_GID needs to be set!"; exit 100
-fi
-
-useradd \
- --uid ${HOST_USER_ID} \
- --gid ${HOST_USER_GID} \
- --create-home \
- --shell /bin/bash \
- ${HOST_USER_NAME}
-groupadd --gid "${HOST_USER_GID}" "${HOST_USER_NAME}"
-usermod -aG sudo ${HOST_USER_NAME}
-sleep 5s
-
-echo ${HOST_USER_NAME}:${HOST_USER_NAME} | chpasswd
-
-exec su - "${HOST_USER_NAME}"
-
diff --git a/lcpubsh/image_template/user_mapping.sh b/lcpubsh/image_template/user_mapping.sh
new file mode 120000
index 0000000..e51feef
--- /dev/null
+++ b/lcpubsh/image_template/user_mapping.sh
@@ -0,0 +1 @@
+../bin/user_mapping.sh \ No newline at end of file