From b544f7af1e2ef481e68156886375e31fdb0de2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 7 Dec 2025 17:19:58 +0200 Subject: [PATCH] Update Device Types feature in Init script --- init.sh | 9 ++++++--- src/functions/init.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) 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