Guest User

Untitled

a guest
Dec 11th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ### SCRIPT
  2. #!/bin/sh
  3. # PROVIDE:liveping
  4. # REQUIRE: netif routing
  5. # BEFORE: NETWORKING
  6.  
  7. # Liveping: Stall the boot process until we can either ping the
  8. # host set in rc.conf or the nameserver to be sure we are ready to
  9. # start network services and mount NFS. Timeout after 60 seconds
  10. # unless specified otherwise.
  11. #
  12. # Add the following line to /etc/rc.conf to enable liveping:
  13. #
  14. # liveping_enable="YES"
  15. # # optional
  16. # liveping_target="192.168.1.1"
  17. # liveping_timeout="60"
  18. #
  19.  
  20. detected_nameserver=`sed -n "s/nameserver //p" /etc/resolv.conf`
  21.  
  22. . "/etc/rc.subr"
  23.  
  24. # Set some defaults
  25. liveping_enable=${liveping_enable:-"NO"}
  26. liveping_target=${liveping_target:-"$detected_nameserver"}
  27. liveping_timeout=${liveping_timeout:-"60"}
  28.  
  29. name=liveping
  30. rcvar=`set_rcvar`
  31. load_rc_config $name
  32. command=/sbin/ping
  33. command_args="-o -t ${liveping_timeout} ${liveping_target} > /dev/null 2>&1"
  34.  
  35. run_rc_command "$1"
  36. ### END
Add Comment
Please, Sign In to add comment