Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/manage-slaves
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-01-22 09:57:42 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2022-01-22 09:57:42 +0100
commit2efd41488dfef764dadda6d6a970de813b21419a (patch)
tree5d803e3385e498fcf98f6f0264e859fa793b188f /bin/manage-slaves
parentde26d3c539b999a771eeba329f24fc593d9672ed (diff)
manage-slaves: added a "list" command
Diffstat (limited to 'bin/manage-slaves')
-rwxr-xr-xbin/manage-slaves16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/manage-slaves b/bin/manage-slaves
index cddda84..3dbd83a 100755
--- a/bin/manage-slaves
+++ b/bin/manage-slaves
@@ -9,6 +9,7 @@ usage() {
>&2 echo 'manage-slaves $action [parameters]: manage the list of build slaves'
>&2 echo ''
>&2 echo 'possible actions:'
+ >&2 echo ' list'
>&2 echo ' add $name $owner $ssh-key-fingerprint'
>&2 echo ' disable $name'
>&2 echo ' enable $name'
@@ -33,6 +34,21 @@ if errors=$(
fi
case "$1" in
+ 'list')
+ infos=$(
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT'
+ printf ' name, CASE WHEN access_allowed = 1 THEN "enabled" ELSE "disabled" END '
+ printf ' name, CASE WHEN is_sane = 1 THEN "sane" ELSE "not sane" END '
+ printf ' FROM build_slaves'
+ printf ';\n'
+ } | \
+ mysql_run_query | \
+ tr '\t' ' '
+ )
+ echo "${infos[@]}"
+ ;;
'add')
shift
if [ $# -ne 3 ]; then