Compare commits
No commits in common. "726d20b8f73f07fd0ca23dd17e8975a0a1239744" and "83f2a98d79014b6715847ecef87e44d14e0915f3" have entirely different histories.
726d20b8f7
...
83f2a98d79
1 changed files with 3 additions and 32 deletions
35
bambu.sh
35
bambu.sh
|
@ -94,15 +94,12 @@ function bambu_file() {
|
||||||
ls)
|
ls)
|
||||||
bambu_ls "$@"
|
bambu_ls "$@"
|
||||||
;;
|
;;
|
||||||
put])
|
upload)
|
||||||
bambu_put "$@"
|
bambu_upload "$@"
|
||||||
;;
|
;;
|
||||||
rm)
|
rm)
|
||||||
bambu_rm "$@"
|
bambu_rm "$@"
|
||||||
;;
|
;;
|
||||||
get)
|
|
||||||
bambu_get "$@"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
die "Unknown subcommand $subcommand"
|
die "Unknown subcommand $subcommand"
|
||||||
;;
|
;;
|
||||||
|
@ -136,7 +133,7 @@ function bambu_ls() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function bambu_put() {
|
function bambu_upload() {
|
||||||
local directory="$(preprocess_directory_path "$2")"
|
local directory="$(preprocess_directory_path "$2")"
|
||||||
curl_ftps_command "$directory" -T "$1"
|
curl_ftps_command "$directory" -T "$1"
|
||||||
}
|
}
|
||||||
|
@ -146,32 +143,6 @@ function bambu_rm() {
|
||||||
curl_ftps_command "" -Q "DELE /$file" > /dev/null 2>&1 || echo "Failed to delete file $file"
|
curl_ftps_command "" -Q "DELE /$file" > /dev/null 2>&1 || echo "Failed to delete file $file"
|
||||||
}
|
}
|
||||||
|
|
||||||
function bambu_get() {
|
|
||||||
local file=""
|
|
||||||
local output_path="$PWD"
|
|
||||||
|
|
||||||
while [ ! -z "$1" ]; do
|
|
||||||
case "$1" in
|
|
||||||
-o|--output)
|
|
||||||
output_path="$2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
die "Unknown option $1"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
file="$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -z "$file" ] && die "Path to file not specified"
|
|
||||||
|
|
||||||
curl_ftps_command "$file" -o "$output_path/$(basename "$file")"
|
|
||||||
}
|
|
||||||
|
|
||||||
function bambu_print() {
|
function bambu_print() {
|
||||||
local subcommand="$1"
|
local subcommand="$1"
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Add table
Reference in a new issue