Add client script
Signed-off-by: Tristan Andrus <tristan@tristanandrus.com>
This commit is contained in:
parent
f4c8b07814
commit
4bf53be3e3
|
|
@ -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."
|
||||||
Loading…
Reference in New Issue