Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### SCRIPT
- #!/bin/sh
- # PROVIDE:liveping
- # REQUIRE: netif routing
- # BEFORE: NETWORKING
- # Liveping: Stall the boot process until we can either ping the
- # host set in rc.conf or the nameserver to be sure we are ready to
- # start network services and mount NFS. Timeout after 60 seconds
- # unless specified otherwise.
- #
- # Add the following line to /etc/rc.conf to enable liveping:
- #
- # liveping_enable="YES"
- # # optional
- # liveping_target="192.168.1.1"
- # liveping_timeout="60"
- #
- detected_nameserver=`sed -n "s/nameserver //p" /etc/resolv.conf`
- . "/etc/rc.subr"
- # Set some defaults
- liveping_enable=${liveping_enable:-"NO"}
- liveping_target=${liveping_target:-"$detected_nameserver"}
- liveping_timeout=${liveping_timeout:-"60"}
- name=liveping
- rcvar=`set_rcvar`
- load_rc_config $name
- command=/sbin/ping
- command_args="-o -t ${liveping_timeout} ${liveping_target} > /dev/null 2>&1"
- run_rc_command "$1"
- ### END
Add Comment
Please, Sign In to add comment