Files
paste_senden_holen/README.md
2026-04-23 20:33:25 +00:00

97 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Paste Scripts
Zwei Bash-Scripts zum Hoch- und Runterladen von Dateien über eine selbst gehostete [Pinnwand](https://github.com/supakeen/pinnwand)-Instanz.
## Voraussetzungen
- `curl`
- `python3`
- Laufende Pinnwand-Instanz (siehe [docker-compose.yaml](docker-compose.yaml))
## Installation
```bash
chmod +x paste_senden.sh paste_holen.sh
```
---
## paste_senden.sh
Lädt eine Datei zu Pinnwand hoch und gibt die URL sowie die Paste-ID aus.
### Verwendung
```bash
./paste_senden.sh <datei> [host]
```
| Argument | Beschreibung | Standard |
|---|---|---|
| `datei` | Pfad zur hochzuladenden Datei | (Pflichtfeld) |
| `host` | URL der Pinnwand-Instanz | `http://localhost:8000` |
### Beispiele
```bash
# Mit Standard-Host
./paste_senden.sh meincode.py
# Mit eigenem Host
./paste_senden.sh meincode.py http://meinserver:8000
```
### Ausgabe
```
Paste URL: http://meinserver:8000/MM
Paste-ID: MM
```
---
## paste_holen.sh
Ruft den Inhalt eines Pastes anhand seiner ID ab und gibt ihn auf der Standardausgabe aus.
### Verwendung
```bash
./paste_holen.sh <paste-id> [host]
```
| Argument | Beschreibung | Standard |
|---|---|---|
| `paste-id` | ID des Pastes (letzter Teil der URL) | (Pflichtfeld) |
| `host` | URL der Pinnwand-Instanz | `http://localhost:8000` |
### Beispiele
```bash
# Inhalt anzeigen
./paste_holen.sh MM
# Inhalt in Datei speichern
./paste_holen.sh MM > ausgabe.py
# Mit eigenem Host
./paste_holen.sh MM http://meinserver:8000
```
---
## Tipps
Paste direkt aus einem Script heraus erstellen:
```bash
./mein_script.sh | tee /tmp/out.txt && ./paste_senden.sh /tmp/out.txt
```
Logdatei schnell teilen:
```bash
./paste_senden.sh /var/log/syslog
```
Paste-Ablaufzeit ist standardmäßig auf **1 Tag** gesetzt. Dies lässt sich in `paste_senden.sh` über den Wert `"expiry"` anpassen (`1day`, `1week`, `1month`).