Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 36 lines (30 sloc) 822 Bytes
#!/bin/bash
set -e -f -u -o pipefail
retry() {
local sleep_time=10
until "$@"; do
sleep "${sleep_time}"
done
}
update-single-host() {
local host="$1"
printf "\\n\\n\\njohntobin@%s\\n" "${host}"
retry ssh -o ControlMaster=no -t "johntobin@${host}" update-dotfiles-and-bin
printf "\\n\\n\\nroot@%s\\n" "${host}"
# sudo dscl . -change /Users/root UserShell /bin/sh /bin/bash
retry ssh -o ControlMaster=no -t "johntobin@${host}" \
sudo --login update-dotfiles-and-bin
printf "\\n\\n\\narianetobin@%s\\n" "${host}"
retry ssh -o ControlMaster=no -t "arianetobin@${host}" update-dotfiles-and-bin
}
main() {
if [[ "$#" -eq 0 ]]; then
exec "$0" laptop imac hosting
fi
retry update-dotfiles-and-bin
local host
for host in "$@"; do
update-single-host "${host}"
done
}
main "$@"