
brenobernini
(usa CentOS)
Enviado em 05/06/2014 - 18:30h
Boa noite galera
sou novo em bash
portanto gostaria de uma ajuda de vcs
tenho este script aaqui
ao terminar o sleep do else gostaria de voltar ao início do while (#inícioo) novamente para verificar se as linhas estão livres para gerar novas ligações seria um loop até o while terminar de ler o arquivo /home/script/$1
basicamente gostaria de fazer um loop se der else volta pro início do while (#inicioo)
Galera agradeço mto a ajuda att
---------------------------------------------------
#! /bin/bash
CHANNLIMIT=1
while read line
do
#inicioo
num=`/usr/sbin/asterisk -rx "core show channels" | grep "active call" | cut -d' ' -f1`
#echo $num
if [ "${num}" -lt "${CHANNLIMIT}" ]; then
#then
echo linhas livres
#echo -e "$line"
echo Channel: SIP/$line > /home/script/$line.call
echo MaxRetries: 1 >> /home/script/$line.call
echo RetryTime: 20 >> /home/script/$line.call
echo WaitTime: 10 >> /home/script/$line.call
echo Context: from-internal-custom >> /home/script/$line.call
echo Extension: 10011 >> /home/script/$line.call
echo Priority: 1 >> /home/script/$line.call
else
echo linhas estão ativas !
sleep 3
#ao terminar o sleep gostaria de voltar ao início do while (#inícioo) novamente para verificar se as linhas estão livres para gerar novas ligações seria um loop até o while terminar de ler o arquivop /home/script/$1
fi
done < /home/script/$1
echo teste