This commit is contained in:
Morgan 2024-03-13 03:33:30 +09:00
parent 10ffad73cd
commit e07d26f9a1
No known key found for this signature in database
1 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,12 @@ if [ $# -lt 2 ]; then
exit 1 exit 1
fi fi
if [ -t 1 ]; then
echo "Error: Refusing writing to terminal."
exit 1
fi
out=$(mktemp) out=$(mktemp)
init="$1" init="$1"
shift shift
@ -53,5 +59,5 @@ payload_line=$((payload_line + 1))
sed -i "s/PAYLOAD_LINE=__PAYLOAD_LINE__/PAYLOAD_LINE=${payload_line}/" ${out} sed -i "s/PAYLOAD_LINE=__PAYLOAD_LINE__/PAYLOAD_LINE=${payload_line}/" ${out}
cat ${out} > mybinary;
chmod +x mybinary; cat ${out};