'Generic Commit'
Some checks failed
Build-Test-Publish / build (push) Failing after 14s

This commit is contained in:
Your Name
2025-06-22 10:15:10 +12:00
parent ce10325a7f
commit 9c64c8cdce
9 changed files with 7863 additions and 34 deletions

11
sos/sos
View File

@ -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"