Created
June 30, 2011 11:36
-
-
Save cthiel/1056056 to your computer and use it in GitHub Desktop.
SUSE Studio: Run AutoYaST profile on appliance's first boot, example 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE profile> | |
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> | |
<general> | |
<ask-list config:type="list"> | |
<ask> | |
<dialog config:type="integer">20</dialog> | |
<element config:type="integer">20</element> | |
<help><![CDATA[ | |
<p><b>Virtual IP address</b><br>Enter the IP address | |
matching the Virtual Hostname for your system.</p> | |
]]></help> | |
<file>/tmp/ay_q_virt_ip_addr</file> | |
<question>Enter (virt.) IP-Addr</question> | |
<stage>cont</stage> | |
<default>10.0.0.1</default> | |
<script> | |
<filename>chk_virt_ip.sh</filename> | |
<rerun_on_error config:type="boolean">true</rerun_on_error> | |
<environment config:type="boolean">true</environment> | |
<source><![CDATA[ | |
function check_ip() { | |
local ip=$1 tmp phys_ip | |
[ -z "$ip" ] && echo "You must provide a valid IP address!" && | |
return 1 | |
[ "${#ip}" -lt 7 ] && echo "Is this a valid IP address? You | |
entered only '${#ip}' chars." && return 1 | |
[ -n "${ip//[0-9.]/}" ] && echo "An IP address can only | |
contain digits and dots ('.'). Found this: '${ip//[0-9.]/}'." && | |
return 1 | |
tmp="${ip//[0-9]/}" | |
[ "${#tmp}" -ne 3 ] && echo "An IP address can only contain 3 | |
dots." && return 1 | |
[ "${phys_ip}" = "${ip}" ] && echo "The virt. IP address has | |
to differ from the phys. IP address ($ip)." && return 1 | |
return 0 | |
} | |
check_ip "$VAL" | |
]]></source> | |
<debug config:type="boolean">false</debug> | |
<feedback config:type="boolean">true</feedback> | |
</script> | |
</ask> | |
</ask-list> | |
</general> | |
</profile> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good morning,
I would like to ask you for help, I am not to experienced on using linux automation xml files.
I was asked to create a xml file that prompts for server name, IP, default gateway, and other options, will sufring the internet I found your autoyast.xml example. I tried to mimic the same format with 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 work is to validate the input entered to be less than 13 characters, only alfanumeric 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