diff options
author | Jon Clausen <jac@nordu.net> | 2018-07-16 15:33:13 +0200 |
---|---|---|
committer | Jon Clausen <jac@nordu.net> | 2018-07-16 15:33:13 +0200 |
commit | 6a0b2abfafdcb305d9b3036d0bf297dad5fc1fac (patch) | |
tree | c7abc2c9a07a98993ee6f1184333dbaf723d77d3 | |
parent | b9876117303129f90f2ade126736d6879caabecb (diff) |
just do a bunch of if/thens
-rwxr-xr-x | adapt-ks-template | 36 |
1 files changed, 20 insertions, 16 deletions
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 |