This commit is contained in:
11
sos/sos
11
sos/sos
@ -2,13 +2,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
# get dropshell
|
||||
# get getpkg
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
ARCH=$(uname -m)
|
||||
curl -L -s -o "${TEMP_DIR}/dropshell" "https://getbin.xyz/dropshell.${ARCH}" || die "Failed to download dropshell"
|
||||
chmod +x "${TEMP_DIR}/dropshell"
|
||||
curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg"
|
||||
chmod +x "${TEMP_DIR}/getpkg"
|
||||
trap 'rm -rf "${TEMP_DIR}"' EXIT
|
||||
DROPSHELL="${TEMP_DIR}/dropshell"
|
||||
GETPKG="${TEMP_DIR}/getpkg"
|
||||
|
||||
|
||||
function show_help() {
|
||||
@ -42,7 +42,6 @@ function datetime() {
|
||||
date -u +"%Y.%m%d.%H%M"
|
||||
}
|
||||
|
||||
|
||||
function upload() {
|
||||
if [ "$#" -lt 3 ]; then
|
||||
echo "Usage: sos upload <server> <file> <label:tag> [label:tag ...]"
|
||||
@ -78,7 +77,7 @@ function upload() {
|
||||
LABELTAGS_JSON="[${LABELTAGS_JSON%,}]"
|
||||
|
||||
# trip whitespace from the file path
|
||||
LOCALHASH=$("${DROPSHELL}" hash "${file}" | tr -d '[:space:]')
|
||||
LOCALHASH=$("${GETPKG}" hash "${file}" | tr -d '[:space:]')
|
||||
echo "Local hash: $LOCALHASH"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user