#!/bin/bash set -e echo # osx support command -v gtar >/dev/null && command -v gfind >/dev/null && { tar() { gtar "$@"; } sed() { gsed "$@"; } find() { gfind "$@"; } sort() { gsort "$@"; } } which md5sum 2>/dev/null >/dev/null && md5sum=md5sum || md5sum="md5 -r" mode="$1" [ -z "$mode" ] && { echo "need argument 1: (D)ry, (T)est, (U)pload" echo exit 1 } [ -e copyparty/__main__.py ] || cd .. [ -e copyparty/__main__.py ] || { echo "run me from within the copyparty folder" echo exit 1 } # one-time stuff, do this manually through copy/paste true || { cat > ~/.pypirc <