#!/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