Find the answer to your Linux question:
Results 1 to 2 of 2
How to make an install script for the script below? Code: #!/bin/bash if eval "ping -c 1 xxxx"; then echo "Internet konekcija funkcionise" else echo "Internet konekcija ne funkcionise" fi ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    1

    Issue with install script

    How to make an install script for the script below?
    Code:
    #!/bin/bash
    if eval "ping -c 1 xxxx"; then
    echo "Internet konekcija funkcionise"
    else
    echo "Internet konekcija ne funkcionise"
    fi
    Any help?

  2. #2
    Just Joined!
    Join Date
    Jul 2010
    Posts
    53
    presuming xxxx is something you should be able to ping (like yahoo.com) - something like:

    Code:
    ping -c 1 xxxx > /dev/null
    if [ $? -eq 0 ]; then
      echo "yes"
    else
      echo "no"
    fi

Posting Permissions

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