]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/install+setup/install/downloadsource.sh
ef7d34917c477e1482d206e733274be3ad4579bb
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / downloadsource.sh
1 #!/bin/sh
2 ###############################################################################
3 # #
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2010 IPFire Team <info@ipfire.org> #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 # Path for testing. Need to be changed for release!
23 IPFireISO=people.ipfire.org/~arne_f/testing/next/ipfire.iso
24 #IPFireISO=download.ipfire.org/iso/ipfire.iso
25
26 #Get user defined download from boot cmdline
27 grep "netinstall=" /proc/cmdline > /dev/null && CMDLINE=1
28 if ( [ "$CMDLINE" == "1" ]); then
29 read CMDLINE < /proc/cmdline
30 POS=${CMDLINE%%netinstall*}
31 POS=${#POS}
32 IPFireISO=`echo ${CMDLINE:POS} | cut -d"=" -f2 | cut -d" " -f1`
33 fi
34
35 echo
36 echo "Configure Network with DHCP..."
37 dhcpcd
38 echo
39 echo "Download with wget..."
40 wget $IPFireISO -O /tmp/download.iso -t3 -U IPFire_NetInstall/2.x
41 echo
42 echo "Checking download..."
43 mount /tmp/download.iso -o loop /cdrom 2> /dev/null
44 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
45 echo -n "null" > /tmp/source_device
46 echo "Found tarball in /tmp/download.iso"
47 exit 0
48 else
49 echo "Found no tarballs in /tmp/download.iso - SKIP"
50 fi
51 umount /cdrom 2> /dev/null
52 exit 10