From c27e1484883e4c6a635dd182ada542426aa48abf Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Fri, 12 Apr 2024 07:42:57 +0000 Subject: [PATCH] Trying to fix vscode issue. Updating to version 2.0.55 --- entrypoint.sh | 11 ++++++++--- version.txt | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index e5dfdb3..ad66fa7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,13 @@ #!/bin/bash set -eu +# Check if we are root +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exec sudo /usr/bin/entrypoint.sh + exit 0 +fi + if [[ -z "${HOME_USER-}" ]]; then HOME_USER="vscode" fi @@ -59,9 +66,7 @@ if [ "${HOME_USER-}" ]; then # Delete the vscode user if id "vscode" &>/dev/null; then sudo chown -R vscode:vscode /home/vscode - sudo pkill -u vscode - sleep 2 # wait for processes to terminate - sudo -u root bash -c 'userdel -r vscode' + sudo userdel -r vscode fi else # Switch to the user specified by $HOME_USER and start an interactive shell session. diff --git a/version.txt b/version.txt index 795654c..33b655a 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.54 \ No newline at end of file +2.0.55 \ No newline at end of file