diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-03-12 16:48:59 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-03-12 16:48:59 +1300 |
commit | 4d930a550815d7da54dba2950527f3dba8d7f9f7 (patch) | |
tree | 52266f6913805f760fde4c3d94ed3aed1073fb7d /bash/bashrc.d/sudo.bash | |
parent | Fix stray comment (diff) | |
download | dotfiles-4d930a550815d7da54dba2950527f3dba8d7f9f7.tar.gz dotfiles-4d930a550815d7da54dba2950527f3dba8d7f9f7.zip |
Don't force -H for sudo if -v
Diffstat (limited to 'bash/bashrc.d/sudo.bash')
-rw-r--r-- | bash/bashrc.d/sudo.bash | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/bashrc.d/sudo.bash b/bash/bashrc.d/sudo.bash new file mode 100644 index 00000000..41a97a9e --- /dev/null +++ b/bash/bashrc.d/sudo.bash @@ -0,0 +1,9 @@ +# Add the -H parameter to sudo(8) calls, always use the target user's $HOME +sudo() { + if [[ $1 == -v ]] ; then + command sudo "$@" + else + command sudo -H "$@" + fi +} + |