31 lines
546 B
Bash
Executable File
31 lines
546 B
Bash
Executable File
#!/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."
|