From 4bbe7f51cbbe81994f06866f9591799748bd6c48 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Thu, 18 Apr 2024 05:22:53 +0000 Subject: [PATCH] Update environment variable handling and version number to 3.0.23 --- entrypoint.sh | 30 +++++++++++++++--------------- version.txt | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index b70203d..220fb1d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,26 +35,26 @@ do fi done +# List all environment variables +printenv | + +# Filter variables that start with USER_ENV_ +grep -E '^USER_ENV_' | + +# Remove the USER_ENV_ prefix +sed 's/^USER_ENV_//' | + +# Append the result to /usr/bin/.bashrc +while IFS= read -r line +do + echo "export $line" | sudo -u ${HOME_USER} tee -a /usr/bin/.bashrc +done + USER="$HOME_USER" if ! id -u $HOME_USER > /dev/null 2>&1; then sudo adduser --disabled-password --gecos "" --uid 1000 ${HOME_USER} sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null - # List all environment variables - printenv | - - # Filter variables that start with USER_ENV_ - grep -E '^USER_ENV_' | - - # Remove the USER_ENV_ prefix - sed 's/^USER_ENV_//' | - - # Append the result to /usr/bin/.bashrc - while IFS= read -r line - do - echo "export $line" | sudo -u ${HOME_USER} tee -a /usr/bin/.bashrc - done - # Creating .vscode folder if it doesn't exist if [ ! -d "/home/${HOME_USER}/.vscode" ]; then sudo mkdir -p /home/${HOME_USER}/.vscode diff --git a/version.txt b/version.txt index 812aaaf..1290e20 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.0.22 \ No newline at end of file +3.0.23 \ No newline at end of file