1if [ ! "$_MEDIA_HTTP_SUBR" ]; then _MEDIA_HTTP_SUBR=1
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/http.subr 264840 2014-04-23 22:04:04Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/http.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 474 unchanged lines hidden (view full) ---
510 if f_http_check_access; then
511 http_found=$SUCCESS
512 break
513 fi
514 done
515 fi
516 esac
517
518 if [ $http_found -eq $SUCCESS ]; then
519 HTTP_INITIALIZED=YES
520 break
521 fi
522
523 f_getvar $VAR_HTTP_PATH http_path
524 f_show_msg "$msg_please_check_the_url_and_try_again" \
525 "$http_path"
526
527 unset HTTP_INITIALIZED $VAR_HTTP_PATH
528 f_media_set_http || break
529 done
--- 135 unchanged lines hidden (view full) ---
665 [ $retval -eq 200 ] && return $SUCCESS
666 [ "$probe_type" ] && return $FAILURE
667
668 case "$retval" in
669 5) f_show_msg "$msg_server_error_when_requesting_url" "$url" ;;
670 44) f_show_msg "$msg_url_was_not_found" "$url" ;;
671 4) f_show_msg "$msg_client_error" ;;
672 *) f_show_msg "$msg_error_when_requesting_url" "$url" ;;
673 esac
674 return $FAILURE
675}
676
677# f_media_shutdown_http $device
678#
679# Shuts down the HTTP device. Return status should be ignored. Note that since
680# we don't maintain an open connection to the HTTP server, nothing to do.
681#
--- 12 unchanged lines hidden ---
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/http.subr 264840 2014-04-23 22:04:04Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/http.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 474 unchanged lines hidden (view full) ---
510 if f_http_check_access; then
511 http_found=$SUCCESS
512 break
513 fi
514 done
515 fi
516 esac
517
518 if [ $http_found -eq $SUCCESS ]; then
519 HTTP_INITIALIZED=YES
520 break
521 fi
522
523 f_getvar $VAR_HTTP_PATH http_path
524 f_show_msg "$msg_please_check_the_url_and_try_again" \
525 "$http_path"
526
527 unset HTTP_INITIALIZED $VAR_HTTP_PATH
528 f_media_set_http || break
529 done
--- 135 unchanged lines hidden (view full) ---
665 [ $retval -eq 200 ] && return $SUCCESS
666 [ "$probe_type" ] && return $FAILURE
667
668 case "$retval" in
669 5) f_show_msg "$msg_server_error_when_requesting_url" "$url" ;;
670 44) f_show_msg "$msg_url_was_not_found" "$url" ;;
671 4) f_show_msg "$msg_client_error" ;;
672 *) f_show_msg "$msg_error_when_requesting_url" "$url" ;;
673 esac
674 return $FAILURE
675}
676
677# f_media_shutdown_http $device
678#
679# Shuts down the HTTP device. Return status should be ignored. Note that since
680# we don't maintain an open connection to the HTTP server, nothing to do.
681#
--- 12 unchanged lines hidden ---