Skip to content

Instantly share code, notes, and snippets.

usage() {
echo "引数を入力"
}
if [ -z "$1" ]
then
usage
exit 0
fi
#!/bin/sh
port=9999
while true
do
http_status=`curl -LI localhost:$port/health_check -o /dev/null -w '%{http_code}\n' -s`
if [ "$http_status" == "200" ]; then
break
fi
#!/bin/sh
set -e
lockfile=${TMP:-/tmp}/${0##*/}
i=1
while [ $i -eq 1 ]; do
if [ ! -e $lockfile ]; then
i=`expr $i + 1`
#!/bin/sh
ROOT=$(cd $(dirname "$0") && pwd)
echo $ROOT
#!/bin/sh
set -e
if [ $# -ne 2 ]; then
echo "指定された引数は$#個です。" 1>&2
echo "実行するには比較するファイル名を引数1と2に入力してください。" 1>&2
exit 1
fi
#!/bin/sh
i=1
end=15
ip="192.168.0."
svrstr=astel
end=`expr $end + 1`
while [ $i -lt $end ]; do
if [ $i -lt 10 ]; then
#!/bin/sh
ether-wake -i eth0 xx:xx:xx:xx:xx:xx
hostip=192.168.0.xx
set -eu
i=0
while true
#!/bin/sh
# zabbixのスクリーンにインポートするxmlをつくるシェルスクリプト。
# 完全に自分用 いらなそうな処理もあるけど。
# zabbix2.2
# 100台以上の想定はしてない(そもそもその数をスクリーンで見ると重い)
# $ sh zbx_screen.sh > out.xml でxmlをインポートする。
host_name="astel00"
server_number=42
#!/bin/sh
#メインPCに動画を送ってエンコードさせるスクリプト。
#video_dirに保存している.ts動画を全てエンコードする。
#メインPCがついていなかった場合、WOLで起動させる。
#エンコードした動画名はDBにinsertする。
#エンコードした動画はowncloudのディレクトリに移動させる。
#ssh i7でメインpcにsshできるようにしておく。
#DB設定などは最終行に記述。
#!/bin/sh
if [ $$ != `pgrep -fo $0` ]; then
echo `basename $0` is already running.
exit 1
fi