tnx-termcast - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
tnx-termcast (627B)
---
1 #!/bin/sh
2 #
3 # start recording a script, and upload it in base64 to sprunge
4 # usage: nx-termcast [url]
5
6 nx_upload() {
7 # feel free to override, if you know what you're doing
8 curl -sLT${1:--} https://p.iotek.org
9 }
10
11 nx_record() {
12 script --timing=timing typescript
13 # make a motherfucking tarbomb
14 tar cz . | base64 | nx_upload
15 }
16
17 nx_replay() {
18 curl -s "$*" | base64 -d | tar xz
19 scriptreplay timing typescript
20 }
21
22 # that's to prevent the motherfucking tarbombs
23 cd $(mktemp -d)
24
25 # give the impression of a clean session
26 clear
27
28 # either record or play, your choice
29 test -n "$1" && nx_replay "$*" || nx_record