diff --git a/paste_holen.sh b/paste_holen.sh index 26647af..05ca1f9 100644 --- a/paste_holen.sh +++ b/paste_holen.sh @@ -1,11 +1,12 @@ #!/bin/bash -PASTE_ID="$1" # Aufruf: ./paste_holen.sh abc123 +PASTE_ID="$1" +HOST="${2:-http://100.87.87.103:8184}" if [ -z "$PASTE_ID" ]; then - echo "Verwendung: $0 " + echo "Verwendung: $0 [host]" exit 1 fi -curl -s "https://pastebin.com/raw/$PASTE_ID" - +curl -s "$HOST/api/v1/paste/$PASTE_ID" | \ + python3 -c 'import json,sys; print(json.loads(sys.stdin.read())["files"][0]["content"])' \ No newline at end of file