commit a89a08c459b505b41589a5e768f766d6d10b3122
parent 0acea594ba6501c67f4afc408e71386dc5f605b2
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Tue, 13 Aug 2024 18:44:06 +0200
feat: also use dynamic salt in bash function
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pastesrv.sh b/pastesrv.sh
@@ -10,7 +10,8 @@ pastesrv() {
SSH_PASTESRV="paste[AT]paste[DOT]example.com"
WEB_PASTESRV="https://paste.example.com"
# set default file name if none is given
- HASH=$(date +%s | sha256sum | awk '{ print $1 }')
+ TMP=$(date +%s)
+ HASH=$(echo "$TMP $RANDOM" | sha256sum | awk '{ print $1 }')
# forward stdin to the server
ssh "$SSH_PASTESRV" "cat > ~/paste/${1:-$HASH}"
# output for user