Hello.
<code>
#!/bin/bash
set -x
IPADDRESS=$2
EXT=$1
_ST=`mdsh -c "susip:dir=$EXT;" | grep IPX | cut -d" " -f 4`
if [ -z $_ST ]; then
echo "$EXT $IPADDRESS" >> _LIST_SUSIP
exit 0
fi
if [ $_ST = "IDLE" ]; then
curl -s "
-d "passw=Ericsson" -d "subbut=Log+on" > /dev/null
curl -s "
> /dev/null
_OUT=$?
if [ $_OUT = "0" ]; then
echo "$EXT $IPADDRESS" >> _LIST_IDLE
elif [ $_OUT = "52" ]; then
echo "$EXT $IPADDRESS" >> _LIST_AUTH
fi
elif [ $_ST = "SPEECH" ]; then
echo "$EXT $IPADDRESS" >> _LIST_SPEECH
elif [ $_ST ="CALTER" ]; then
echo "$EXT $IPADDRESS" >> _LIST_CALTER
elif [ $_ST ="CALORG" ]; then
echo "$EXT $IPADDRESS" >> _LIST_CALORG
else
echo "$EXT $IPADDRESS" >> _LIST_UNDEFINED
fi
</code>
script checks that IP ext is in IDLE state and if it is - then it reboot phone.
Also script writes few lists _LIST_SPEECH, _LIST_CALTER etc..
syntax:
reboot_iphone.sh _ext_ _ip_addr_
notice that all my ip phones has default password for web page.
Maybe this will be usefull for you
BR
--
mark