[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Script help...............



Hi debian world...




Im not know very much about scripts so i need some help with one..

Here my situation:

A script will be executed when i call to my linux box... here it is: 

/etc/init.d/xringd stop
/root/IP_MAIL
pon incomingcall    <--------------------
/etc/init.d/xringd start                |
                                        |
                                        |

				This has the -detach option so i can kill it and the script will continue...



Now, i have problems with /root/IP_MAIL, becouse it try to send me my ip number before i can get one... this is how IP_mail looks:

1)DAY=$(date +%A)
2)NUMBER=$(date +%d)
3)TIME=$(date +%r)
4)MONTH=$(date +%m)
5)IP=$(/sbin/ifconfig | grep inet | awk '{print $2}' |awk -F: '{print $2}' | grep -v 127)
6)echo "Today, $DAY   $NUMBER/$MONTH  [$TIME] you have got an ip address: $IP" > /tmp/iptemporal.tmp
7)mail -s "Identidad: $IP" filsin@innocent.com < /tmp/iptemporal.tmp


in filsin@innocent.com i get:
Today, Monday   26/10  [07:45:12 PM] you have got an ip address:


so how can i make IP_MAIL do 1,2,3,4 and 5 until $IP is not empty ?? (is $IP is not empty then go on and send the mail...)



Thanks,
Phillip Neumann
filsin@bigfoot.com


Reply to: