summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Clausen <jac@nordu.net>2018-09-04 14:29:53 +0200
committerJon Clausen <jac@nordu.net>2018-09-04 14:29:53 +0200
commit1e6a68ee7c18d6754f43151875add9fbb2688fcc (patch)
treeaf76fb78384f197723cdcac1f41771d40f850f62
parent19a74883609d30cdfce4852fd4915cf51ad912d5 (diff)
do not insist on secondary interface options
-rwxr-xr-xadapt-ks-template31
-rwxr-xr-xprep-boot-floppy-and-ks-config32
2 files changed, 21 insertions, 42 deletions
diff --git a/adapt-ks-template b/adapt-ks-template
index 5f7b815..f81cd23 100755
--- a/adapt-ks-template
+++ b/adapt-ks-template
@@ -180,24 +180,6 @@ function check_options {
print_usage
exit 1
fi
- if [ "x${SecIP}" = "x" ]
- then
- echo "${Self}: --sec-ip is mandatory"
- print_usage
- exit 1
- fi
- if [ "x${SecNM}" = "x" ]
- then
- echo "${Self}: --sec-nm is mandatory"
- print_usage
- exit 1
- fi
- if [ "x${SecGW}" = "x" ]
- then
- echo "${Self}: --sec-gw is mandatory"
- print_usage
- exit 1
- fi
if [ "x${Kserver}" = "x" ]
then
Kserver="109.105.122.84"
@@ -261,14 +243,21 @@ sed -ie "s/PRIIP/${IP}/g" "${TmpDir}/ks-template"
sed -ie "s/PRINETMASK/${NM}/g" "${TmpDir}/ks-template"
sed -ie "s/PRIGATEWAY/${GW}/g" "${TmpDir}/ks-template"
sed -ie "s/PRINAMESERVERS/${NS}/g" "${TmpDir}/ks-template"
-sed -ie "s/SECIP/${SecIP}/g" "${TmpDir}/ks-template"
-sed -ie "s/SECNETMASK/${SecNM}/g" "${TmpDir}/ks-template"
-sed -ie "s/SECGATEWAY/${SecGW}/g" "${TmpDir}/ks-template"
sed -ie "s#KRNLCMDLINE#${KrnlCmdLineOpt}#g" "${TmpDir}/ks-template"
sed -ie "s#BOOTDEV#${BootDev}#g" "${TmpDir}/ks-template"
sed -ie "s#CLEARPART#${ClearPart}#g" "${TmpDir}/ks-template"
sed -ie "s#USEDISK#${UseDisk}#g" "${TmpDir}/ks-template"
+if [ -z ${SecIP} ] || [ -z ${SecNM} ] || [ -z ${SecGW}]
+then
+ sed -ie 's/--ip=SECIP.*/--onboot=off --ipv6=auto/' "${TmpDir}/ks-template"
+else
+ sed -ie 's/^#SIR#//' "${TmpDir}/ks-template"
+ sed -ie "s/SECIP/${SecIP}/g" "${TmpDir}/ks-template"
+ sed -ie "s/SECNETMASK/${SecNM}/g" "${TmpDir}/ks-template"
+ sed -ie "s/SECGATEWAY/${SecGW}/g" "${TmpDir}/ks-template"
+fi
+
if [ "x${PublishPath}" = "x" ]
then
echo "PublishPath no set, leaving everything in ${TmpDir}"
diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config
index 298bdbd..c452d3a 100755
--- a/prep-boot-floppy-and-ks-config
+++ b/prep-boot-floppy-and-ks-config
@@ -195,24 +195,6 @@ function check_options {
print_usage
exit 1
fi
- if [ "x${SecIP}" = "x" ]
- then
- echo "${Self}: --sec-ip is mandatory"
- print_usage
- exit 1
- fi
- if [ "x${SecNM}" = "x" ]
- then
- echo "${Self}: --sec-nm is mandatory"
- print_usage
- exit 1
- fi
- if [ "x${SecGW}" = "x" ]
- then
- echo "${Self}: --sec-gw is mandatory"
- print_usage
- exit 1
- fi
if [ "x${CosmosHash}" = "x" ]
then
CosmosHash="2ea14b0b958fdc70ad37e3cb9b4185b3648137b8"
@@ -254,14 +236,22 @@ TmpDir=$(mktemp -d)
ScriptPath=$(echo $0 | sed -e "s#/${Self}##")
#echo $ScriptPath
+# only add 'secondary interface' options, if they're all there:
+if [ -z ${SecIP} ] || [ -z ${SecNM} ] || [ -z ${SecGW} ]
+then
+ SecIfOpts=""
+else
+ SecIfOpts="--sec-ip ${SecIP} --sec-nm ${SecNM} --sec-gw ${SecGW}"
+fi
+
${ScriptPath}/create-boot-floppy -D ${Domain} -G ${GW} -H ${Host} \
-I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} ${InstCmdLineOpt} \
--gen-cmd ${SelfCommandLine}
${ScriptPath}/adapt-ks-template -D ${Domain} -G ${GW} -H ${Host} \
- -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --sec-ip ${SecIP} \
- --sec-nm ${SecNM} --sec-gw ${SecGW} ${TemplateOpt} ${KrnlCmdLineOpt} \
- ${CosmosTagOpt} --gen-cmd ${SelfCommandLine} --boot-dev "${BootDev}" \
+ -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} ${SecIfOpts} \
+ ${TemplateOpt} ${KrnlCmdLineOpt} ${CosmosTagOpt} \
+ --gen-cmd ${SelfCommandLine} --boot-dev "${BootDev}" \
--root-dev "${RootDev}"
# When this script calls the other two, PublishPath *is* set, so expect