Skip to content
This repository was archived by the owner on Mar 25, 2022. It is now read-only.

Commit ecc7bf1

Browse files
author
Lars Gierth
committed
provsn: add get command for retrieving variables
License: MIT Signed-off-by: Lars Gierth <[email protected]>
1 parent 0258c25 commit ecc7bf1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

provsn

+12
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,18 @@ exec)
214214
provsn_in_parallel "$@" || exit 0
215215
provsn_exec "$2" "$3"
216216
;;
217+
get)
218+
hosts=`resolve_pattern "$2"`
219+
test -z "$hosts" && echo "error: unknown host: $2" 1>&2 && exit 1
220+
if test "$(printf %s\\n ${hosts[@]} | wc -l)" -gt 1; then
221+
for host in ${hosts[@]}; do
222+
printf %s\\n "$(lookup "$3")" | awk "{print \"$host: \" \$0}" /dev/stdin
223+
done
224+
else
225+
host="${hosts[0]}"
226+
printf %s\\n "$(lookup $3)"
227+
fi
228+
;;
217229
units)
218230
test -z "$2" && printf %s\\n "${provsn_units[@]}" && exit 0
219231
hosts=`resolve_pattern "$2"`

0 commit comments

Comments
 (0)