[debian-lan-devel] [debian-lan] 02/04: Add check if the network (APT repository) is available.

Andreas B. Mundt andi at moszumanska.debian.org
Fri Apr 4 15:44:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit a1f2bc172eac23ddfdcecf75fca867e7d04733eb
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sun Mar 30 16:08:49 2014 +0200

    Add check if the network (APT repository) is available.
---
 fai/config/hooks/install.DEFAULT.source | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/fai/config/hooks/install.DEFAULT.source b/fai/config/hooks/install.DEFAULT.source
index fb80ac1..b17d79a 100755
--- a/fai/config/hooks/install.DEFAULT.source
+++ b/fai/config/hooks/install.DEFAULT.source
@@ -1,5 +1,23 @@
 #! /bin/bash
 #
+#   Check if network is available.
+#
+
+URL="http://http.debian.net/"
+while ! wget --quiet --output-document=/tmp/network-check $URL ; do
+    echo "Error accessing '$URL', check network and internet access."
+    if ! { dialog --stdout --backtitle " No network/internet access! " \
+        --yes-label "Try again" --no-label "Cancel installation" \
+        --title " No network/internet access! " \
+        --yesno "Could not access '$URL'.\n\
+Please make sure the network is available.\n\n\
+Fix this problem (Ctrl-Alt-F2) and try again." 8 49; } ; then
+        exit 1
+    fi
+done
+
+
+#
 #  Prompt for the root password if $ROOTPW is empty.
 #
 
@@ -22,6 +40,7 @@ else
     done
 fi
 
+
 #
 #  Prompt for the hostname if $HOSTNAME is empty.
 #

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list