update to 5.4
[automated-distro-installer] / fai / config / files / etc / apt / sources.list / preinst
1 #! /bin/bash
2
3 # replace {release} in a sources.list template with the value of $release
4 # replace {apt_cdn} with the value of $apt_cdn
5
6 # $1 is the class name used
7 # $2 is the path to the file copied
8
9 # check if a variable of the form {varname} was used at all
10 grep -q '{' $2 || exit 0
11
12 if [ -z "$release" ]; then
13 echo "\$release is undefined. No substitution performed in $2."
14 else
15 sed -i -e "s/{release}/$release/g" $2
16 fi
17
18 if [ -z "$apt_cdn" ]; then
19 echo "\$apt_cdn not defined. not substituting in $2."
20 else
21 sed -i -e "s#{apt_cdn}#$apt_cdn#g" $2
22 fi
23