# custom autoyast.xml

**URL:** <https://forums.suse.com/t/custom-autoyast-xml/26151>\
**Category:** SLES Install-Boot\
**Created:** [September 29, 2014, 4:40pm UTC](https://forums.suse.com/t/custom-autoyast-xml/26151 "2014-09-29T16:40:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jleon71](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jleon71](https://forums.suse.com/u/jleon71)\
**Post date:** [September 29, 2014, 4:40pm UTC](https://forums.suse.com/t/custom-autoyast-xml/26151/1 "2014-09-29T16:40:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jleon71](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jleon71](https://forums.suse.com/u/jleon71)\
**Post date:** [September 29, 2014, 4:57pm UTC](https://forums.suse.com/t/custom-autoyast-xml/26151/2 "2014-09-29T16:57:18Z")

</div>

Formatted view

```auto
    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>
```
