diff --git a/init.sh b/init.sh index bdceb9c..166a65a 100755 --- a/init.sh +++ b/init.sh @@ -30,9 +30,12 @@ wx-init(){ if [[ ! -z ${args['device-type']} ]] then - if [[ ${args['device-type']} == "server" || ${args['device-type']} == "workstation" ]] + if [[ ${args['device-type']} == "server" ]] then - DEVICE_TYPE="${args['device-type']}" + DEVICE_TYPE="Server" + elif [[ ${args['device-type']} == "workstation" ]] + then + DEVICE_TYPE="Workstation" else wxi-content status "Device Type" "Invalid" wxi-stop @@ -66,7 +69,7 @@ wx-init(){ echo "---" > ~/.ansible/vars.yml echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml echo "info:" >> ~/.ansible/vars.yml - echo " type: $TYPE" >> ~/.ansible/vars.yml + echo " type: $DEVICE_TYPE" >> ~/.ansible/vars.yml echo "config:" >> ~/.ansible/vars.yml echo " identity:" >> ~/.ansible/vars.yml echo " vault:" >> ~/.ansible/vars.yml diff --git a/src/functions/init.sh b/src/functions/init.sh index b4cd0d6..c44c667 100644 --- a/src/functions/init.sh +++ b/src/functions/init.sh @@ -15,9 +15,12 @@ wx-init(){ if [[ ! -z ${args['device-type']} ]] then - if [[ ${args['device-type']} == "server" || ${args['device-type']} == "workstation" ]] + if [[ ${args['device-type']} == "server" ]] then - DEVICE_TYPE="${args['device-type']}" + DEVICE_TYPE="Server" + elif [[ ${args['device-type']} == "workstation" ]] + then + DEVICE_TYPE="Workstation" else wxi-content status "Device Type" "Invalid" wxi-stop @@ -51,7 +54,7 @@ wx-init(){ echo "---" > ~/.ansible/vars.yml echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml echo "info:" >> ~/.ansible/vars.yml - echo " type: $TYPE" >> ~/.ansible/vars.yml + echo " type: $DEVICE_TYPE" >> ~/.ansible/vars.yml echo "config:" >> ~/.ansible/vars.yml echo " identity:" >> ~/.ansible/vars.yml echo " vault:" >> ~/.ansible/vars.yml