custom autoyast.xml

Good morning,

I would like to ask you for help, I don’t have much experience using linux automation xml files.
I was asked to create an xml file that prompts for server name, IP, default gateway, and other options, while surfing the internet I found various autoyas.xml examples. I tried to mimic the examples in my xml file. When I test the xml I get prompted to enter the server name, however the script is not executed, the script is supposed to validate the input entered to be less than 13 characters, only alphanumeric and not null input. The validation part is not working, can you help me with this question.

My OS is SLE SE 11 SP2, below is the part in my xml that I am prompting for the server name.

Thank you

Juan

606
607
608
609 Please enter the Hostname:
610 Server Configuration
611 string
612 initial
613
638
639
640
641 false
642
643 </general

Formatted view

    606   <general>
    607     <ask-list config:type="list">
    608       <ask>
    609         <question>Please enter the Hostname:</question>
    610         <title>Server Configuration</title>
    611         <type>string</type>
    612         <stage>initial</stage>
    613         <script>
    614           <feedback config:type="boolean">true</feedback>
    615           <rerun_on_error config:type="boolean">true</rerun_on_error>
    616           <environment config:type="boolean">true</environment>
    617           <debug config:type="boolean">false</debug>
    618           <filename>configure-server.sh</filename>
    619           <source>
    620             <![CDATA[
    621               #!/bin/bash
    622               VAL=$1
    623               function check_hostname()
    624                        {
    625                         local host=$1
    626                         LC_ALL=POSIX
    627                         [ -z "$host" ] && echo "You need to provide a hostname."  && return 1
    628                         [ "${#host}" -gt 13 ] && echo "The hostname cannot be longer than 13 chars. You entered '${#host}' chars." && return 1
    629                         [ -n "${host//[0-9A-Za-z-]/}" ]  && echo "The hostname can only consist of an alphanumeric string and a hyphen ('-'). Found         this: '${host//[0-9A-Za-z-]/}'."  && return 1
    630                         return 0
    631                        }
    632                check_hostname "$VAL"
    633
    634
    635             ]]>
    636           </source>
    637         </script>
    638       </ask>
    639     </ask-list>
    640     <mode>
    641       <confirm config:type="boolean">false</confirm>
    642     </mode>
    643   </general>