21 lines
656 B
Bash
Executable File
21 lines
656 B
Bash
Executable File
#!/bin/bash
|
|
|
|
encrypt_username=AxhEbscwsJDbYMH2
|
|
encrypt_password=cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4
|
|
|
|
upload_url=http://$encrypt_username:$encrypt_password@132.126.207.124:36800
|
|
|
|
root_path=$(dirname $(cd $(dirname $0);pwd))
|
|
|
|
function upload() {
|
|
source_file_path=$(realpath $1)
|
|
file_name=$(basename $source_file_path)
|
|
echo "↪ Source md5: $(md5sum $source_file_path | awk '{print $1}')"
|
|
echo "↪ Uploading $source_file_path"
|
|
curl $upload_url/file/upload/$file_name -T $source_file_path
|
|
echo "↪ Upload ytp success"
|
|
echo "↪ Download: curl $upload_url/file/download/$file_name -o $file_name"
|
|
echo "↪ Delete source"
|
|
rm $source_file_path
|
|
}
|