From 4bf53be3e3c9db3a019a55da93ba87f780bcdd63 Mon Sep 17 00:00:00 2001 From: Tristan Andrus Date: Tue, 25 Mar 2025 22:56:51 -0600 Subject: [PATCH] Add client script Signed-off-by: Tristan Andrus --- requestsync.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 requestsync.sh diff --git a/requestsync.sh b/requestsync.sh new file mode 100755 index 0000000..47e022d --- /dev/null +++ b/requestsync.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -u -e -o pipefail + +source_file_path="${1:-}" +source_file_name="${2:-}" + +DEST_SERVER="deiopeaii" +AUTH_TOKEN="PitD5xB+Wq6uH7W7UfPtoJo4F6UfWZ9yLrSKZ0bKg9EGoUrK2W77TEI5Y5x1j4uzluqleOo8TGZq2w== + + + + +link_file_to_basket() { + ln -snf "$(realpath "$source_file_path" )" "$HOME/basket/$source_file_name" +} + +request_sync() { + curl -u "me:$AUTH_TOKEN" \ + -X POST \ + "http://${DEST_SERVER}:35350/requestsync" +} + +echo "Linking to basket..." +link_file_to_basket + +echo "Requesting sync..." +request_sync + +echo "Done."