Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vbem committed Oct 12, 2023
1 parent 8c82c3e commit 5f9e8f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ function mr::addRunner {
[[ -n "$repo" ]] && url="$MR_GIHUB_BASEURL/$org/$repo" || url="$MR_GIHUB_BASEURL/$org"

log::stderr DEBUG "Adding runner into local user '$user' for $url"
run::logIfFailed sudo -Hiu "$user" -- bash -eo pipefail <<- __
# `sudo -Hiu "$user"` only adopt $PATH defined in /etc/sudoers
run::logIfFailed sudo su --login "$user" -- -eo pipefail <<- __
mkdir -p runner/mr.d && cd runner/mr.d
echo -n '$org' > org && echo -n '$repo' > repo && echo -n '$url' > url
echo -n '$name' > name && echo -n '$labels' > labels && echo -n '$tarpath' > tarpath
Expand Down Expand Up @@ -255,7 +256,7 @@ function mr::delRunner {
fi

log::stderr DEBUG "Deleting runner local user '$user'"
run::logIfFailed sudo -Hiu "$user" -- bash <<- __
run::logIfFailed sudo su --login "$user" -- <<- __
cd runner
sudo ./svc.sh stop && sudo ./svc.sh uninstall
./config.sh remove --token '$token'
Expand Down

0 comments on commit 5f9e8f8

Please sign in to comment.