#!/bin/sh . /etc/init.d/functions if [ $# -ne 2 ] then echo "USAGE:/bin/sh args1 args2" exit 1 fi for n in 103 104 do scp -P22 $1 shnne@192.168.1.$n:~ &>/dev/null ssh -p22 -t shnne@192.168.1.$n sudo cp ~/$1 $2 >/dev/null 2>&1 if [ $? -eq 0 ] then action "$1 to 192.168.1.$n$2 is ok" /bin/true else aciton "$1 to 192.168.1.$n$2 is no" /bin/false fi done