รบกวนช่วยเขียนสคริปหน่อยครับ

แบบว่าจะให้ httpd มัน restart อัตโนมัติเวลาที่ load มันขึ้นสูงน่ะครับ
ลองของน้อง icez ตามนี้แล้วมันรันไม่ได้
http://www.thaihosttalk.com/index.php?topic=20741.msg258606#msg258606
os : freebsd7.2 + da

ตั้ง cron ให้รันสคริปต์ เช็คไว้เรื่อยๆครับ

ไม่ต้องเขียนให้เหนื่อยครับ

[quote author=siambox.com link=topic=28314.msg265244#msg265244 date=1276875809]
ไม่ต้องเขียนให้เหนื่อยครับ

ขอบคุณมากๆครับ

เอาแบบง่ายๆไปดูเพื่อเป็นแนวทางการเขียน shell script กันนะครับ


#!/bin/sh

#restart $service if load over $limit
limit=20;
service="httpd";
email="notifyemail@domain.tld";

up=`uptime`;
ld=`echo $up | awk -F, '{print $5}' | awk -F. '{print $1}'`;

if [ $ld -gt $limit ]; then

ขอบคุณมากครับพี่แมน ^^