Skip to content

Commit

Permalink
boot: Change the way that the boot return for profile
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Castello <[email protected]>
  • Loading branch information
microhobby committed May 5, 2024
1 parent d9e8137 commit ccb8ed0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 2 additions & 5 deletions cookbook/recipes-wsl/boot/boot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if ($null -eq $_user) {
usermod -aG docker $_user

# create the .bashrc
cp /etc/bashrc.template /home/$_user/.bashrc
cp /etc/bash.bashrc /home/$_user/.bashrc

# and pass the ownership of the home directory to the user
chown -R ${_user}:$_user /home/$_user
Expand Down Expand Up @@ -66,7 +66,7 @@ if ($null -eq $_user) {
touch /mnt/c/Users/Public/.torizon/.configured

# the first configuration we exit for the wizard to finish
exit 0
exit 1
} else {
Write-Host -ForegroundColor Red "Error: User not added?"
exit 69
Expand All @@ -81,6 +81,3 @@ if ($LASTEXITCODE -ne 0) {

# still having controll to the flow
Set-Location /home/$_user
/bin/bash

exit 0
12 changes: 9 additions & 3 deletions cookbook/recipes-wsl/profile/profile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

echo "Welcome to the Torizon WSL 2 v0.0.3"
echo "Welcome to the Torizon WSL 2 v0.0.4"

export PATH

Expand Down Expand Up @@ -33,5 +33,11 @@ fi
# execute the Torizon WSL2 specific script
boot.ps1

echo "Bye!"
exit
# check the return code from the last command
if [ $? -eq 0 ] ; then
echo "Success"
else
echo "Bye!"
wsl.exe -t Torizon
exit
fi

0 comments on commit ccb8ed0

Please sign in to comment.