hipporion/all_reboot.sh
2019-10-01 19:01:56 +02:00

6 lines
330 B
Bash
Executable file

#!/bin/sh
pass=`sed -n 's/telnet_pass=//p' config.txt`
ip=`sed -n 's/server_ip=//p' config.txt | sed 's/\.[0-9]*$//'`
for i in `cat phones.txt | grep -v \- | sed -n 's/^\([0-9][0-9]\).*/\1/p'`; do
{ admin_scripts/send_reboot.pl "$ip.$i" "$i" 2>&1 || admin_scripts/force_reboot.pl "$ip.$i" "$pass" 2>&1 ; } | sed "s/^/$i: /"
done