03/10/2016 - 00:33
- Блог пользователя administrator
- Комментировать
- 154836 reads
Метки: shell script
example reboot phone usage phone-reboot 192.168.0.1
#!/bin/bash
sid=$(curl -s -c /tmp/cookies.txt -d"password=admin" http://${1}/cgi-bin/dologin | sed -r 's|.*"sid" : "([0-9a-z]+)".*|\1|' )
curl -b /tmp/cookies.txt -d"request=REBOOT&sid=${sid}" http://${1}/cgi-bin/api-sys_operation
reboot all founded:
#!/bin/bash +x
str1=`arp -an | grep 00:0B`
rm -rf /tmp/tmp0011
while IFS= read -r line
do
ip=$(echo -n $line | grep -o -E '([0-9]{1,3}\.){3}[0-9a-z]{1,3}')
if [ "${ip}" ] ; then
echo Rebooting ${ip}
echo ${ip} >> /tmp/tmp0011
fi
done <<< "$str1"
str1=`arp -an | grep 00:0B`
rm -rf /tmp/tmp0011
while IFS= read -r line
do
ip=$(echo -n $line | grep -o -E '([0-9]{1,3}\.){3}[0-9a-z]{1,3}')
if [ "${ip}" ] ; then
echo Rebooting ${ip}
echo ${ip} >> /tmp/tmp0011
fi
done <<< "$str1"
xargs -P 0 -n 1 ./phone-reboot </tmp/tmp0011
Навигация
Tags in Метки
1C
1С Предприятие
apache
Asterisk
BIND
BSOD
Centos
citrix
email адреса
Exchange 2007
Exchange 2010
FreeBSD
FreeNAS
FreePBX
Howto
ipmi
iptables
mysql
openvpn
OTRS
OWA
pass. recovery
passgen
ports
RAID
rdp
repair
root
routing
sftp
shell script
SQL2005
ssh
sync
time sync
tone
tool
update
VMware
Win2008x64
Windows 7
Windows 2008
winscp
Установка
восстановление
заголовок Received
как сделать
обновление
поиск
порт
права доступа
резервная копия
Tags for bash multithreading xargs / reboot grandstream voip phones.
Поиск
Вход в систему