source: llx-netinstall/trunk/fuentes/install.llx-netinstall/usr/share/llx-netinstall/templates/d-i-late-command @ 2663

Last change on this file since 2663 was 2663, checked in by mabarracus, 3 years ago

Fix detection

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2#
3# This script is licensed under GPL V3 or higher
4#
5#
6
7
8# First fix the sources list for generic lliurex flavours
9put_apt_conf(){
10    base="${1}"
11    param="${2}"
12
13    if [ -z "${param}" ]; then
14        param="desktop"
15    fi 
16    case $param in
17        "client")
18            SERVER="http://mirror/llx1605"
19        ;;
20#       NOT AVAILABLE IN NETINSTALL
21#       "server")
22#           SERVER="file:///net/mirror/llx1605"
23#       ;;
24        "desktop")
25            SERVER="http://lliurex.net/xenial"
26        ;;
27        ## INFANTIL CASE AND OTHERS
28        *)
29            SERVER="http://lliurex.net/xenial"
30        ;;
31    esac
32   
33    echo "# LliureX Net-Installation ${param}"  >> ${BASE_DIR}/etc/apt/sources.list
34    echo "deb ${SERVER} xenial main universe restricted multiverse"  > ${BASE_DIR}/etc/apt/sources.list
35    echo "deb ${SERVER} xenial-updates main universe restricted multiverse"  > ${BASE_DIR}/etc/apt/sources.list
36    echo "deb ${SERVER} xenial-security main universe restricted multiverse"  > ${BASE_DIR}/etc/apt/sources.list
37}
38
39# Initial param checking
40
41if [ -z "${1}" ]; then 
42    exit 1
43else
44    BASE_DIR="$1"
45fi
46
47if [ ! -d "${BASE_DIR}" -o ! -f "${BASE_DIR}/etc/apt/sources.list" ];then
48    exit 1
49fi
50
51class=$(cat /proc/cmdline |sed -r "s%.*preseed/url=http://preseed/([a-zA-Z_\-]+).cfg .*%\1")
52
53put_apt_conf ${BASE_DIR} ${class}
54
55exit 0
Note: See TracBrowser for help on using the repository browser.