Skip to content

Commit

Permalink
fix su after chsh
Browse files Browse the repository at this point in the history
  • Loading branch information
jpawlowski committed Jul 26, 2024
1 parent b00c6dc commit 443738b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/powershell-extended/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "$POWERSHELL_REPOSITORIES" != '' ]; then
pwsh -NoProfile -Command "$prefs; Set-PSResourceRepository -Name PSGallery -Trusted"
if [ -n "$_REMOTE_USER" ] && [ "$_REMOTE_USER" != 'root' ]; then
echo "[$_REMOTE_USER] Set PSGallery as trusted repository"
su "$_REMOTE_USER" bash -c "pwsh -NoProfile -Command \"$prefs; Set-PSResourceRepository -Name PSGallery -Trusted\""
su "$_REMOTE_USER" /bin/bash -c "pwsh -NoProfile -Command \"$prefs; Set-PSResourceRepository -Name PSGallery -Trusted\""
fi

elif [[ "$repoPrio" =~ ^[0-9]+$ ]] && [ "$repoPrio" -ge 0 ] && [ "$repoPrio" -le 100 ]; then
Expand All @@ -114,7 +114,7 @@ if [ "$POWERSHELL_REPOSITORIES" != '' ]; then
pwsh -NoProfile -Command "$prefs; Set-PSResourceRepository -Name PSGallery -Trusted -Priority $repoPrio"
if [ -n "$_REMOTE_USER" ] && [ "$_REMOTE_USER" != 'root' ]; then
echo "[$_REMOTE_USER] Set PSGallery as trusted repository and update priority to '$repoPrio'"
su "$_REMOTE_USER" bash -c "pwsh -NoProfile -Command \"$prefs; Set-PSResourceRepository -Name PSGallery -Trusted -Priority $repoPrio\""
su "$_REMOTE_USER" /bin/bash -c "pwsh -NoProfile -Command \"$prefs; Set-PSResourceRepository -Name PSGallery -Trusted -Priority $repoPrio\""
fi
else
echo "Invalid priority for 'PSGallery': $repoPrio"
Expand Down Expand Up @@ -164,7 +164,7 @@ if [ "$POWERSHELL_REPOSITORIES" != '' ]; then
pwsh -NoProfile -Command "$prefs; Register-PSResourceRepository $repoargs"
if [ -n "$_REMOTE_USER" ] && [ "$_REMOTE_USER" != 'root' ]; then
echo "[$_REMOTE_USER] Register-PSResourceRepository $repoargs"
su "$_REMOTE_USER" bash -c "pwsh -NoProfile -Command \"$prefs; Register-PSResourceRepository $repoargs\""
su "$_REMOTE_USER" /bin/bash -c "pwsh -NoProfile -Command \"$prefs; Register-PSResourceRepository $repoargs\""
fi

# Add to list of repositories
Expand Down Expand Up @@ -284,7 +284,7 @@ if [ "$POWERSHELL_RESOURCES" != '' ]; then
pwsh -NoProfile -Command "$prefs; Register-PSResourceRepository $repoargs"
if [ -n "$_REMOTE_USER" ] && [ "$_REMOTE_USER" != 'root' ]; then
echo "[$_REMOTE_USER] Register-PSResourceRepository $repoargs"
su "$_REMOTE_USER" bash -c "pwsh -NoProfile -Command \"$prefs; Register-PSResourceRepository $repoargs\""
su "$_REMOTE_USER" /bin/bash -c "pwsh -NoProfile -Command \"$prefs; Register-PSResourceRepository $repoargs\""
fi

# Add to list of repositories
Expand Down

0 comments on commit 443738b

Please sign in to comment.