update to upstream 5.3.4
[automated-distro-installer] / fai / config / files / etc / apt / sources.list / preinst
diff --git a/fai/config/files/etc/apt/sources.list/preinst b/fai/config/files/etc/apt/sources.list/preinst
new file mode 100755 (executable)
index 0000000..e9f0623
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+# replace {release} in a sources.list template with the value of $release
+
+
+# $1 is the class name used
+# $2 is the path to the file copied
+
+# check if a variable of the form {varname} was used at all
+grep -q '{' $2 || exit 0
+
+if [ -z "$release" ]; then
+    echo "\$release is undefined. No substitution performed in $2."
+   exit 0
+fi
+
+sed -i -e "s/{release}/$release/g" $2