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};