3 # Script to verify hint format and to submit it via local mail command.
4 # Needs checkHint script available from the Hints website.
6 # Script depends on the presences of the following executables that
7 # are not included in a standard LFS installation.
11 # Script created by Jim Gifford
12 # Based on script by Oliver Pérès
13 # Modified by Tushar Teredesai
15 ## Configuration params
20 # Whether to submit the hint
21 SUBMIT_HINT
="disabled"
22 # Whether to compress hint before submission
24 # Hints submission address
25 hints
="hints@linuxfromscratch.org"
33 if [ "$HINT_FILE" == "" ]
35 echo "`basename $0` hint-file"
38 if [ "$submitter" = "" ] ||
[ "$email" = "" ]
40 echo "Please edit $0 before executing"
45 mailbin
="`which $mailprog 2>/dev/null`"
46 compressbin
="`which $compressprog 2>/dev/null`"
58 if [ "$input" == "YES" ] ||
[ "$input" == "yes" ] ||
[ "$input" == "Y" ] ||
[ "$input" == "y" ]
63 if [ "$input" == "NO" ] ||
[ "$input" == "no" ] ||
[ "$input" == "N" ] ||
[ "$input" == "n" ]
68 if [ "$RETURN" == "0" ]
74 checkHint
$HINT_FILE || ERROR
="true"
76 if [ "$ERROR" == "" ] && [ "$SUBMIT_HINT" == "enabled" ] && [ "$mailbin" != "" ]
78 YESNO
"Are you sure you want to send $HINT_FILE to $hints (yes/no)"
81 if [ "$COMPRESS" == "enabled" ] && [ "$compressbin" != "" ]
83 echo "Compressing $HINT_FILE..."
84 $compressbin $HINT_FILE
85 attachment
="$HINT_FILE.$compressext"
87 attachment
="$HINT_FILE"
89 echo "Hint Submission: $HINT_FILE" > $MAIL_FILE
90 echo "Sending email to $hints..."
91 $mailbin -B -s "Hint Submission for $HINT_FILE" -a $attachment -r $email $hints < $MAIL_FILE