Skip to content

Commit 6ee2efc

Browse files
committed
Add a tiny pastebin tool to the build
1 parent 50dafce commit 6ee2efc

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ A bunch of simple update scripts are run via [CustoPiZer](https://github.com/Oct
1313
* `02-update-boot`: Updates bootloader and kernel to the latest version
1414
* `03-update-libcamera-apps`: Updates the the libcamera apps to the latest version
1515
* `10-install-camera-streamer`: Installs the new [camera-streamer](https://github.com/ayufan/camera-streamer) based webcam stack, replacing mjpg-streamer and webcamd. The new stack supports libcamera based cameras like the RPi Cam v3 and newer Arducams, and is also more performant. See [the FAQ](https://faq.octoprint.org/camera-streamer-config) for more details.
16+
* `11-install-pb`: Installs a small script under `/usr/local/bin/pb` that allows to easily share stdin or a text file to paste.octoprint.org.
1617
* `80-install-user-fix`: Installs a compatibility layer to support renaming the `pi` user, if needed.
17-
* `99-write-build`: Writes the build tag to `/etc/octopiuptodate-build`.
18+
* `99-write-build`: Writes the build tag to `/etc/octopiuptodate-build`
1819

1920
## How do I run this?
2021

scripts/11-install-pb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
set -x
2+
set -e
3+
4+
export LC_ALL=C
5+
6+
source /common.sh
7+
install_cleanup_trap
8+
9+
# if input_raspi.so is there, we don't need to do anything
10+
[ -f /usr/local/bin/pb ] && exit 0
11+
12+
cp /files/pb /usr/local/bin/pb
13+
chmod +x /usr/local/bin/pb

scripts/files/pb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SERVER="https://paste.octoprint.org"
4+
5+
FILE=$1
6+
output=$(/usr/bin/curl -sSL -X POST --data-binary @${FILE:--} $SERVER/api/pastes/simple)
7+
echo "$SERVER/$output"

0 commit comments

Comments
 (0)