summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatze Miau <miaukatzemiau@priveasy.de>2011-12-06 15:54:39 (GMT)
committerKatze Miau <miaukatzemiau@priveasy.de>2011-12-06 15:54:39 (GMT)
commit12d678dd4dde1c8c4ac349c956c7103709a22b6f (patch)
tree0b64065ee6c5eb12ac5bbe2c448328dd774175b2
parent0fdc08e375904c7e48fb95ec026f3806e023d710 (diff)
add p2ptbl show subcommand
lists an entire table (but without the version of each row)
-rwxr-xr-xfiles/common/sbin/p2ptbl9
1 files changed, 9 insertions, 0 deletions
diff --git a/files/common/sbin/p2ptbl b/files/common/sbin/p2ptbl
index a728a9c..e30a7d0 100755
--- a/files/common/sbin/p2ptbl
+++ b/files/common/sbin/p2ptbl
@@ -13,6 +13,10 @@ get () {
grep "^$2"$'\t' "$1" | cut -f3-
}
+show () {
+ cut -f1,3- "$1"
+}
+
update () {
[ -n "$2" -a -n "$3" ] || printArgs
oldversion=$(grep "^$2"$'\t' "$1" | cut -f2)
@@ -80,6 +84,7 @@ printArgs () {
echo -e "Usage:
$0 init table
$0 get table key
+$0 show table
$0 update table key value [interface]
$0 merge table foreign-table
$0 gossip table target-size interface"
@@ -108,6 +113,10 @@ case "$1" in
lockTable -s "$2"
get "$2" "$3"
;;
+ show)
+ lockTable -s "$2"
+ show "$2"
+ ;;
update)
lockTable -s "$2"
update "$2" "$3" "$4" "$5"
contact: Jan Huwald // Impressum