Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #141 from digitalrebar/add_fixup_path_to_setup_tmpl
Browse files Browse the repository at this point in the history
add fixup_path() function, add /sbin and /usr/sbin
  • Loading branch information
galthaus authored Sep 13, 2018
2 parents 2146fa4 + 57f78e2 commit e3baaaf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions content/templates/setup.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,17 @@ set -x
[[ $RS_ENDPOINT ]] || export RS_ENDPOINT="{{.ApiURL}}"
[[ $RS_UUID ]] || export RS_UUID="{{.Machine.UUID}}"

mkdir -p /usr/local/bin
grep -q '/usr/local/bin' <<< "$PATH" || export PATH="$PATH:/usr/local/bin"
function fixup_path() {
local _add_path
for _add_path in $(echo $* | sed 's/[:,]/ /g')
do
mkdir -p $_add_path
# inject colons to avoid partial match failures
grep -q ":$_add_path" <<< ":$FOO:" || export FOO="$FOO:$_add_path"
done
}

fixup_path /usr/local/bin /usr/sbin /sbin

# TODO: we need to make drpcli/jq grab smarter to be a little
# more tolerant of OS arch/type - and grab the right one
Expand Down

0 comments on commit e3baaaf

Please sign in to comment.