init-script-template
init-script-template copied to clipboard
Update template
Adding -i to sudo command. This uses a login shell for the $user.
This creates a situation where the current directory is reset to the user's home directory, effectively ignoring the dir variable.
That is a problem. The reason why I submitted this is because I am running a node app via nvm which is loaded via the login scripts. I wonder if setting the user HOME directory to the dir value would be appropriate?
sudo -H "$dir"
If it's not solving any problems then feel free to just close this PR.
Thanks for the template!
well its not my template, but thanks! I suppose that would work for my case, but I could imagine a script that depends on $HOME being accurate breaking.