對多台Server下達相同的指令

#!/bin/sh
WEBs="1 2 3 4 5″
if [ $# -lt 1 ]; then
echo ‘Err:no Param’
exit;
fi

for i in ${WEBs}; do
echo -n "${i}… "
/usr/bin/ssh user@xx.xx.xx.${i} $1
done

echo "DONE!!"

本篇發表於 未分類。將永久鍊結加入書籤。

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>