Compare commits

...

3 Commits

2 changed files with 18 additions and 9 deletions

View File

@ -39,11 +39,14 @@ USER="$HOME_USER"
if ! id -u $HOME_USER > /dev/null 2>&1; then if ! id -u $HOME_USER > /dev/null 2>&1; then
sudo adduser --disabled-password --gecos "" ${HOME_USER} sudo adduser --disabled-password --gecos "" ${HOME_USER}
sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
fi
# Check if the .bashrc file exists, if not, create it # Then execute entrypoint.sh
if [ ! -f /home/${HOME_USER}/.bashrc ]; then if [ "$HOME_USER" != "$(whoami)" ]; then
sudo touch /home/${HOME_USER}/.bashrc exec sudo -u $HOME_USER bash -c "source /etc/environment; /usr/bin/entrypoint.sh"
fi
# Execute the entrypoint.sh script as the user
else
# Change the ownership of the .bashrc file # Change the ownership of the .bashrc file
sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc
@ -62,11 +65,17 @@ if ! id -u $HOME_USER > /dev/null 2>&1; then
do do
echo "export $line" | sudo tee -a /home/${HOME_USER}/.bashrc echo "export $line" | sudo tee -a /home/${HOME_USER}/.bashrc
done done
fi
# Then execute entrypoint.sh # Source the .bashrc file to apply the changes immediately
if [ "$HOME_USER" != "$(whoami)" ]; then sudo su -l ${HOME_USER} -c "source ~/.bashrc"
exec sudo -u $HOME_USER bash -c "source /etc/environment; /usr/bin/entrypoint.sh"
# Creating .vscode folder if it doesn't exist
if [ ! -d "/home/${HOME_USER}/.vscode" ]; then
sudo mkdir -p /home/${HOME_USER}/.vscode
fi
# Changing the property of the directory /home/${HOME_USER}/.vscode
sudo chown -R ${HOME_USER}: /home/${HOME_USER}/.vscode
fi fi
# Find .sh files in /usr/bin/custom-scripts and execute them in order # Find .sh files in /usr/bin/custom-scripts and execute them in order

View File

@ -1 +1 @@
3.0.7 3.0.10