X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Ffiles%2Fetc%2Fapt%2Fsources.list%2Fpreinst;h=f67d8d9883e28e671611f09cd6878e38a70c15af;hp=e9f06236a122570bd92fae9321d1707209be4b13;hb=2773c14668a490a1254a63541e1ef9fd3377104b;hpb=7024f2155d8d5e4754d5c1ce0ccf8352149f81cd diff --git a/fai/config/files/etc/apt/sources.list/preinst b/fai/config/files/etc/apt/sources.list/preinst index e9f0623..f67d8d9 100755 --- a/fai/config/files/etc/apt/sources.list/preinst +++ b/fai/config/files/etc/apt/sources.list/preinst @@ -1,7 +1,7 @@ #! /bin/bash # replace {release} in a sources.list template with the value of $release - +# replace {apt_cdn} with the value of $apt_cdn # $1 is the class name used # $2 is the path to the file copied @@ -11,7 +11,13 @@ grep -q '{' $2 || exit 0 if [ -z "$release" ]; then echo "\$release is undefined. No substitution performed in $2." - exit 0 +else + sed -i -e "s/{release}/$release/g" $2 +fi + +if [ -z "$apt_cdn" ]; then + echo "\$apt_cdn not defined. not substituting in $2." +else + sed -i -e "s#{apt_cdn}#$apt_cdn#g" $2 fi -sed -i -e "s/{release}/$release/g" $2