init-script-template icon indicating copy to clipboard operation
init-script-template copied to clipboard

Update template

Open gardner opened this issue 9 years ago • 3 comments

Adding -i to sudo command. This uses a login shell for the $user.

gardner avatar Apr 15 '16 01:04 gardner

This creates a situation where the current directory is reset to the user's home directory, effectively ignoring the dir variable.

wizpig64 avatar Apr 30 '16 20:04 wizpig64

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!

gardner avatar May 01 '16 03:05 gardner

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.

wizpig64 avatar May 01 '16 18:05 wizpig64