Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.profile created as root if it does not already exist #19

Open
hoyle-ub opened this issue Sep 29, 2023 · 0 comments
Open

.profile created as root if it does not already exist #19

hoyle-ub opened this issue Sep 29, 2023 · 0 comments
Assignees

Comments

@hoyle-ub
Copy link

If a user does not already have a .profile when this script is run, the file is created with owner 'root', rather than the user who ran the script. There's probably a more elegant way to fix this, but I just added:

if [[ ! -f /Users/${consoleuser}/.profile ]]; then
su -l "$consoleuser" -c "/usr/bin/touch /Users/${consoleuser}/.profile"
fi

inside the if statement that sets the shellenv for M1 users.

@Honestpuck Honestpuck self-assigned this Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants