17 lines
252 B
Bash
17 lines
252 B
Bash
appendpath () {
|
|
case ":$PATH:" in
|
|
*:"$1":*)
|
|
;;
|
|
*)
|
|
PATH="${PATH:+$PATH:}$1"
|
|
esac
|
|
}
|
|
|
|
if [ $(id -u) -eq 0 ]; then
|
|
appendpath "/root/.local/bin"
|
|
else
|
|
appendpath "/home/$(id -un)/.local/bin"
|
|
fi
|
|
export PATH
|
|
|