dmesgdb/var/www/comment

20 lines
415 B
Bash
Executable File

#!/bin/sh
. /var/common.sh
get_param token
[ "$token" = "Unknown" ] && fail
HD="$DB/$token"
[ -e "$HD" ] && {
get_param comment
[ "$comment" = "Unknown" ] && fail "ERROR: no comment"
[ ${#comment} -gt 128 ] && fail "too much comment size (need <= 128 bytes)"
echo -en "$comment" > "$HD/comment"
}
echo -en "Content-type: text/html\r\n\r\n"
echo "Ok"
echo "Your comment: '$comment' has been accepted"
exit 0