Add missing make-conf and make-urls used by the live distros
authorJohn 'Warthog9' Hawley <warthog9@kernel.org>
Fri, 9 Oct 2009 00:12:36 +0000 (00:12 +0000)
committerJohn 'Warthog9' Hawley <warthog9@kernel.org>
Fri, 9 Oct 2009 00:23:47 +0000 (00:23 +0000)
install_help/make-conf [new file with mode: 0755]
install_help/make-urls [new file with mode: 0755]

diff --git a/install_help/make-conf b/install_help/make-conf
new file mode 100755 (executable)
index 0000000..ffc1cb1
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+filebase="$1"
+configfile="$2"
+
+. "${configfile}"
+
+IFS="
+"
+cat ${filebase}.bko.tmpl > ${filebase}.conf
+
+for x in $( cat urls )
+do
+       tosub="$( echo "${x}" | awk 'BEGIN { FS="="; } ; { print $1; }' )"
+       whatsub="$( echo "${x}" | awk 'BEGIN { FS="="; } ; { print $2; }' | sed 's/\//\\\//g' )"
+       sed -i "s/@${tosub}@/${whatsub}/g" ${filebase}.conf
+done
+
+sed -i "s/@ISCSI_SERVER@/${ISCSI_SERVER}/g" ${filebase}.conf
diff --git a/install_help/make-urls b/install_help/make-urls
new file mode 100755 (executable)
index 0000000..cbfa8fb
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+cat *.tmpl | grep "@.*@" | tr "=" "\n" | tr " " "\n" | grep "@.*@" | sed 's/\@//g' > temp.url
+if [[ -e urls ]]
+then
+       cat urls | awk 'BEGIN { FS="="; } ; { print $1; }' > temp.known.urls
+else
+       cat /dev/null > temp.known.urls
+fi
+IFS="
+"
+for x in $( cat temp.url | grep -v -f temp.known.urls )
+do
+       echo "${x}=" >> urls
+done
+
+rm -rf temp.known.urls temp.url