From 6a0b2abfafdcb305d9b3036d0bf297dad5fc1fac Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Mon, 16 Jul 2018 15:33:13 +0200 Subject: just do a bunch of if/thens --- adapt-ks-template | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'adapt-ks-template') diff --git a/adapt-ks-template b/adapt-ks-template index f6573de..137cc59 100755 --- a/adapt-ks-template +++ b/adapt-ks-template @@ -105,59 +105,63 @@ function parse_commadline { esac shift done +} + +function check_options { if [ "x${Host}" = "x" ] then echo "${Self}: --host is mandatory" print_usage exit 1 - elif [ "x${Domain}" = "x" ] + fi + if [ "x${Domain}" = "x" ] then echo "${Self}: --domain is mandatory" print_usage exit 1 - elif [ "x${IP}" = "x" ] + fi + if [ "x${IP}" = "x" ] then echo "${Self}: --ip is mandatory" print_usage exit 1 - elif [ "x${NM}" = "x" ] + fi + if [ "x${NM}" = "x" ] then echo "${Self}: --netmask is mandatory" print_usage exit 1 - elif [ "x${GW}" = "x" ] + fi + if [ "x${GW}" = "x" ] then echo "${Self}: --gateway is mandatory" print_usage exit 1 - elif [ "x${SecIP}" = "x" ] + fi + if [ "x${SecIP}" = "x" ] then echo "${Self}: --sec-ip is mandatory" print_usage exit 1 - elif [ "x${SecNM}" = "x" ] + fi + if [ "x${SecNM}" = "x" ] then echo "${Self}: --sec-nm is mandatory" print_usage exit 1 - elif [ "x${Kserver}" = "x" ] + fi + if [ "x${Kserver}" = "x" ] then - echo "setting Kserver" Kserver="109.105.122.84" - elif [ "x${NS}" = "x" ] + fi + if [ "x${NS}" = "x" ] then NS="109.106.96.141" fi } parse_commadline ${@} - -# for some bizarre reason, whichever is the last 'elif' in parse_commandline() -# isn't evaluated. So this is needed to make sure $NS is set to something: -if [ "x${NS}" = "x" ] -then - NS="109.105.96.141" -fi +check_options if [ "x${TmpDir}" = "x" ] then -- cgit v1.1