I have the following code:
RESPOSTA=$(asterisk -rx "sip show peers" |grep 4003 |awk -F" " '{print $6}')
if[["$RESPOSTA" == "OK"]];then
echo $RESPOSTA
elif[["$RESPOSTA" == "Unmonitored"]];then
if[["$RESPOSTA" == "(Unspecified)"]]; then
cp /dados/automatico.call /var/spool/asterisk/outgoing/
asterisk -rx reload
fi
echo $RESPOSTA
fi
But it is generating this error:
/dates/status.sh: line 5: syntax error near unexpected token
then' /dados/status.sh: line 5:
if [["$ RESPONSE" == "OK"]]; then '