構文エラーが発生し続けます (予期しないファイルの終わり)。構文は私には良さそうに見えますが、ここでは明らかに何かが間違っています。外部からの誰かが洞察から提供できることを望んでいました。
read -p "Create default hosts file?: " yn
case $yn in
[Yy] ) echo "Creating default hosts file"
sleep 1
cat <<-EOF1 > /etc/hosts
Do not remove the following line, or various programs that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.1 test01
192.168.1.2 test02
192.168.1.3 test03
EOF1
if [ "$(wc -m /etc/hosts)" == "215 /etc/hosts" ] ; then
echo -e "Default Hosts file\e[1;32m COMPLETE \e[0m"
else
echo -e "Default hosts file\e[1;31m FAILED \e[0m"
sleep 1
echo "Please correct before continuing"
echo "EXITING..."
sleep 1
exit
fi;;
[Nn] ) echo 'Searching "/etc/hosts" for test03 entry'
sleep 1
grep "test03" /etc/hosts >/dev/null
if [ "$?" -eq 0 ] ; then
echo "Entry found!"
echo "Setup Continuing..."
else
echo '"test03" entry not found'
sleep 1
echo "Please correct before continuing"
sleep 1
echo "EXITING..."
sleep 1
exit
fi;;
* ) echo "Please answer [Yy] or [Nn].";;
esac