s/whoami/id -un/

This commit is contained in:
Michael Vines 2018-09-05 11:07:59 -07:00
parent ec38dba209
commit 6560b0e2cc
3 changed files with 4 additions and 4 deletions

View File

@ -40,10 +40,10 @@ echo --- Remove unused docker networks
docker network prune -f
)
echo "--- Delete /tmp files older than 1 day owned by $(whoami)"
echo "--- Delete /tmp files older than 1 day owned by $(id -un)"
(
set -x
find /tmp -maxdepth 1 -user "$(whoami)" -mtime +1 -print0 | xargs -0 rm -rf
find /tmp -maxdepth 1 -user "$(id -un)" -mtime +1 -print0 | xargs -0 rm -rf
)
echo --- Deleting stale buildkite agent build directories

View File

@ -6,7 +6,7 @@ source "$here"/../scripts/gcloud.sh
# shellcheck source=net/common.sh
source "$here"/common.sh
prefix=testnet-dev-$(whoami | sed -e s/[^a-z0-9].*//)
prefix=testnet-dev-$(id -un | sed -e s/[^a-z0-9].*//)
validatorNodeCount=5
clientNodeCount=1
leaderMachineType=n1-standard-16

View File

@ -205,7 +205,7 @@ gcloud_FigureRemoteUsername() {
# instance is reported as RUNNING and when it's reachable over the network
timeout 30s bash -c "set -o pipefail; until ping -c 3 $publicIp | tr - _; do echo .; done"
gcloud compute ssh "$name" --zone "$zone" -- "echo whoami \$(whoami)" | tee whoami
gcloud compute ssh "$name" --zone "$zone" -- "echo whoami \$(id -un)" | tee whoami
)
[[ "$(tr -dc '[:print:]' < whoami; rm -f whoami)" =~ ^whoami\ (.*)$ ]] || {