diff options
Diffstat (limited to 'adapt-ks-template')
-rwxr-xr-x | adapt-ks-template | 31 |
1 files changed, 10 insertions, 21 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}" |