]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/installer/execute-postinstall.sh
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2014 IPFire Team <info@ipfire.org> #
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. #
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. #
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/>. #
20 ###############################################################################
23 wget
-U "IPFire-NetInstall/2.x" "$@"
27 echo "$0: Insufficient number of arguments" >&2
34 DOWNLOAD_TARGET
="/tmp/post-install.exe"
36 if download
-O "${DESTINATION}${DOWNLOAD_TARGET}" "${DOWNLOAD_URL}"; then
37 echo "Downloading post-install script from ${DOWNLOAD_URL}..."
40 chmod a
+x
"${DESTINATION}${DOWNLOAD_TARGET}"
42 # Replace /etc/resolv.conf so that we will have
43 cp -fb /etc
/resolv.conf
${DESTINATION}/etc
/resolv.conf
44 for i
in /dev
/proc
/sys
; do
45 mount
--bind "${i}" "${DESTINATION}${i}"
48 # Execute the downloaded script
49 chroot
"${DESTINATION}" sh
--login -c "${DOWNLOAD_TARGET}"
52 # Cleanup the environment
53 mv -f ${DESTINATION}/etc
/resolv.conf
{~
,}
54 for i
in /dev
/proc
/sys
; do
55 umount
"${DESTINATION}${i}"
57 rm -f "${DESTINATION}${DOWNLOAD_TARGET}"
61 # In case the download failed
63 echo "Could not download the post-install script" >&2