diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2004-03-08 02:07:03 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2004-03-08 02:07:03 +0000 |
commit | 58ec73aeeef2792a973c075e11d0e790e9ac4190 (patch) | |
tree | 783690efcc046b08cc7587126e1c90985d75c77e /Tools | |
parent | 19d79570967caffda1d73da9a84a4515d2a45e58 (diff) |
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/allgohans | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/allgohans b/Tools/portbuild/scripts/allgohans new file mode 100755 index 000000000000..391a8a60bc12 --- /dev/null +++ b/Tools/portbuild/scripts/allgohans @@ -0,0 +1,50 @@ +#!/bin/sh + +doarch() { + arch=$1 + shift + + if [ -f "${pb}/${arch}/portbuild.conf" ]; then + . ${pb}/${arch}/portbuild.conf + else + echo "Invalid arch" + exit 1 + fi + + machines=$(awk '{print $1}' ${pb}/${arch}/mlist) + + for i in ${machines}; do + if [ ${quiet} -eq 0 ]; then + echo "[$i]" + fi + su ports-${arch} -c "ssh root@$i $@" + done +} + +id=$(whoami) +if [ "${id}" = "root" ]; then + arch=$1 + shift + root=1 +else + arch=$(echo $id | sed s,ports-,,) + root=0 +fi + +if [ "$1" = "-q" ]; then + quiet=1 + shift +else + quiet=0 +fi + +pb=/var/portbuild +if [ "${arch}" = "all" ]; then + arches=$(find ${pb}/*/portbuild.conf) + for i in ${arches}; do + arch=$(basename $(dirname $i)) + doarch $arch "$@" + done +else + doarch $arch "$@" +fi |