Indeed, you have an open-ended single-quote which should be closed.
But...you have bigger problems than that, because this is a *remote* script. So, statements like this:
Code:
ssh HOST <<EOF
echo $HOSTNAME
EOF
will show the
local value of HOSTNAME, since the script is evaluated by the shell before it is sent to the remote host. So, all variables that you don't want evaluated need to be escaped (i.e., "\$HOSTNAME"). If you don't need to reference
ANY local variables, you can prevent the script from being evaluated be escaping the "EOF" separator:
Code:
ssh HOST <<\EOF
# the backslash above will prevent the Variables below from being evaluated
echo $HOSTNAME
EOF
Generally, when attempting to code/debug these kinds of scripts, you should send them to a local file to ensure the code evaluates the way you expect, and then you can run "sh -n" to verify the syntax:
Code:
cat <<EOF > /tmp/test.script
# this is a temporary location
echo $VALUE1 \$VALUE1
EOF