diff options
Diffstat (limited to 'data/ip-dns-conf')
| -rw-r--r-- | data/ip-dns-conf | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/data/ip-dns-conf b/data/ip-dns-conf new file mode 100644 index 00000000..f14ecd88 --- /dev/null +++ b/data/ip-dns-conf @@ -0,0 +1,86 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Set IP and DNS configuration ... + +############################################################################# + +# Depends on running network interface, provides IP and DNS configuration + +# Dns and ip configuration, hostname of the machine --> to be merged with udhcpc.default.script!! +echo "$host_name" >/proc/sys/kernel/hostname +echo -e "# /etc/hosts - file generated by $0 during OpenSLX stage3\ +\n#\n# IP-Address Full-Qualified-Hostname Short-Hostname\n#\n\ +127.0.0.1\tlocalhost\n::1\t\tlocalhost ipv6-localhost ipv6-loopback\n\ +fe00::0\t\tipv6-localnet\nff00::0\t\tipv6-mcastprefix\nff02::1\ +\t\tipv6-allnodes\nff02::2\t\tipv6-allrouters\nff02::3\t\t\ +ipv6-allhosts\n" >/etc/hosts +if [ -n "${domain_name}" ]; then + echo -en "${clientip}\t" >>/etc/hosts + for name in ${domain_name}; do + echo -en "${host_name}.${name} " >>/etc/hosts + done + echo -e "${host_name}" >>/etc/hosts +else + echo -e "${clientip}\t${host_name}" >>/etc/hosts +fi +# set up domainname and resolving +#rm -rf /etc/resolv.conf + +out=/etc/resolv.conf +echo -e "# /etc/resolv.conf - file generated by\n#\t$0:\n\ +#\t${date}\n#options timeout:1 attempts:1 rotate" > $out + +[ "x${domain_name}" != "x" ] && echo -e "domain ${domain_name}" >> $out +[ "x${domain_search}" != "x" ] && echo -e "search ${domain_search}" >> $out +# fallback +[ "x${domain_search}" == "x" ] && [ "x${domain_name}" != "x" ] && \ + echo -e "search ${domain_name}" >> $out + +[ -n "${domain_name_servers}" ] && { + for name in ${domain_name_servers}; do + echo nameserver ${name} >> $out; + done; } + +# Create hostname file +[ -n ${host_name} ] && [ -n ${domain_name} ] && \ + echo "${host_name}.${domain_name}" > /etc/hostname + + +# Set greeting and add information on booted system +len=$(expr length ${SLXVERSION}${SYSTEM_NAME}) +if [ $len -le 28 ] ; then + vdstr="Stateless Workstation (V${SLXVERSION}/${SYSTEM_NAME})" + smax=28 +else + vdstr="V${SLXVERSION}/${SYSTEM_NAME}" + smax=52 +fi +while [ $len -le $smax ] ; do + vdstr="$vdstr " + len=$(($len + 1)) +done +len=$(expr length ${host_name}) +while [ $len -le 30 ] ; do + space="$space " + len=$(($len + 1)) +done +echo " + WELCOME TO $space \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| + + $vdstr (c) <OpenSLX.ORG> +" >/etc/issue |
