diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-02-22 15:58:30 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-02-22 15:58:30 +0300 |
commit | 5e0d6a17ebfe7f008c53712d679a0b1bc090bcdc (patch) | |
tree | 0c71566a507ba418abd1b10ee65aff767003389c /tools/vkos.sh | |
parent | aca05941386a1733614aaf0a6264098164ae1720 (diff) |
vkos: add some automation
Diffstat (limited to 'tools/vkos.sh')
-rwxr-xr-x | tools/vkos.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/vkos.sh b/tools/vkos.sh index ebe0d66..69860de 100755 --- a/tools/vkos.sh +++ b/tools/vkos.sh @@ -8,6 +8,10 @@ die() { exit 1 } +vkos() { + $PROGNAME "$@" +} + usage() { cat <<EOF usage: $PROGNAME [OPTIONS] COMMAND @@ -20,6 +24,7 @@ Supported commands: list NODE fetch NODE PREFIX merge + auto DATE EOF exit } @@ -31,6 +36,7 @@ NODE= PREFIX= FROM_BACKUP=0 DONT_DELETE=0 +DATE= while [[ $# -gt 0 ]]; do case "$1" in list) @@ -50,6 +56,12 @@ while [[ $# -gt 0 ]]; do COMMAND="$1" ;; + auto) + COMMAND="$1" + DATE="$2" + shift + ;; + -b) FROM_BACKUP=1 ;; @@ -96,4 +108,20 @@ case "$COMMAND" in if [ "$DONT_DELETE" = "0" ]; then args="-D"; fi $DIR/merge-recordings.py $args ;; + + auto) + [ -z "$DATE" ] && usage + DATE_WO_DOTS=${DATE//./} + + cd ~/vkos + mkdir $DATE + cd $DATE + for node in bh1 room; do + mkdir $node + cd $node + vkos fetch $node $DATE_WO_DOTS + vkos merge -d + cd .. + done + ;; esac |