Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Posts
    325

    What does this script do?

    Could anyone tell me what does this script do

    Code:
    #!/bin/bash
    
    ld=`uptime | awk -F, '{print $5}' | awk -F. '{print $1}'`;
    limit=5;
    
    if [ $ld -gt $limit ]; then
    `service httpd restart`;
    fi
    thanks in advance.

  2. #2
    Join Date
    Jun 2004
    Location
    Ontario Canada
    Posts
    259
    It checks your servers load average to see if it is greater than the limit set (in this case 5). If it is, it restarts your http service (probably apache)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •