Add client script

Signed-off-by: Tristan Andrus <tristan@tristanandrus.com>
This commit is contained in:
Tristan Andrus 2025-03-25 22:56:51 -06:00
parent f4c8b07814
commit 4bf53be3e3
1 changed files with 30 additions and 0 deletions

30
requestsync.sh Executable file
View File

@ -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."