From e07d26f9a1e15a6bf3775fc0f4d5af8e8405257a Mon Sep 17 00:00:00 2001 From: Morgan Date: Wed, 13 Mar 2024 03:33:30 +0900 Subject: [PATCH] Fix --- makebin.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/makebin.sh b/makebin.sh index a7542c8..2105723 100755 --- a/makebin.sh +++ b/makebin.sh @@ -5,6 +5,12 @@ if [ $# -lt 2 ]; then exit 1 fi +if [ -t 1 ]; then + echo "Error: Refusing writing to terminal." + exit 1 +fi + + out=$(mktemp) init="$1" shift @@ -53,5 +59,5 @@ payload_line=$((payload_line + 1)) sed -i "s/PAYLOAD_LINE=__PAYLOAD_LINE__/PAYLOAD_LINE=${payload_line}/" ${out} -cat ${out} > mybinary; -chmod +x mybinary; \ No newline at end of file + +cat ${out};